【问题标题】:`npm install npm` gives gyp ERR and npm ERR`npm install npm` 给出 gyp ERR 和 npm ERR
【发布时间】:2019-01-04 14:18:56
【问题描述】:

为什么我在执行sudo npm install npm 时会收到这个奇怪的错误?我有时在尝试安装其他模块时也会得到它!

错误:

> scrypt@6.0.3 preinstall /home/user/code/project/api_v0.8/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /home/user/code/project/api_v0.8/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/project/api_v0.8/node_modules/scrypt/build'
gyp ERR! System Linux 4.20.0-042000-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/code/project/api_v0.8/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN api_v0.8@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我该怎么做才能全新安装我的软件包?

【问题讨论】:

    标签: javascript node.js npm npm-install gyp


    【解决方案1】:

    要解决这个问题,安装节点版本管理器:

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

    用户节点 v8.15.0:

    nvm install 8.15.0
    nvm use 8.15.0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-28
      • 1970-01-01
      • 2015-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-04
      • 2021-08-05
      相关资源
      最近更新 更多