• mac上安装webpack报错解决方法Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/webpack


    node-pre-gyp WARN Using needle for node-pre-gyp https download
    node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@10.14.1 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib'
    gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/simley/.node-gyp/10.14.1"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/webpack/node_modules/fsevents/.node-gyp"
    gyp WARN install got an error, rolling back install
    gyp WARN install got an error, rolling back install
    gyp ERR! configure error
    gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/webpack/node_modules/fsevents/.node-gyp'
    gyp ERR! System Darwin 18.2.0
    gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
    gyp ERR! cwd /usr/local/lib/node_modules/webpack/node_modules/fsevents
    gyp ERR! node -v v10.14.1
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
    node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
    node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
    node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
    node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
    node-pre-gyp ERR! System Darwin 18.2.0
    node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/webpack/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /usr/local/lib/node_modules/webpack/node_modules/fsevents
    node-pre-gyp ERR! node -v v10.14.1
    node-pre-gyp ERR! node-pre-gyp -v v0.10.3
    node-pre-gyp ERR! not ok
    Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/webpack/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/webpack/node_modules/fsevents):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: `node install`

    ---------------------

    解决方案

    sudo npm install webpack -g

    欢迎捐赠

     

  • 相关阅读:
    Yii2 使用 Beanstalk 队列系统
    Yii2 注册表单验证规则 手机注册时候使用短信验证码
    Yii2 高级模板 多域名管理问题
    PHP生成缩略图,控制图片质量,支持.png .jpg .gif
    yii2-lock-form 也许这就是你想要的,阻止表单多次提交
    PHP日期与时间戳转换
    PHP/Yii2操作Cookie,常见问题以及注意事项
    对称加密,API加密
    yii2弹出层
    两种不同的Context
  • 原文地址:https://www.cnblogs.com/sexintercourse/p/10674330.html
Copyright © 2020-2023  润新知