NPM / Nodejs:无法安装scrypt@6.0.3

时间:2018-12-30 20:59:18

标签: node.js installation npm-install node-gyp scrypt

实际上,我正在尝试安装express-basic-auth,但是由于安装了scrypt@6.0.3而失败。我已经尝试过:

sudo apt-get install build-essential

,还尝试删除~/.node-gyp,如此处所述:https://github.com/nodejs/node-gyp/issues/809,但所有建议均无济于事。我仍然遇到相同的错误:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/a/b/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/a/b/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN b@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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-12-30T20_52_24_060Z-debug.log

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我通过在本地安装节点的较早版本(在本例中为节点8.10.0版本)解决了此问题。我不再遇到您遇到的相同错误。删除您的节点模块和package-lock.json然后运行

g = (
    df.stack()
      .to_frame('Count')
      .rename_axis(index=['Age Range', 'Status'])
      .reset_index()
      .pipe((sns.factorplot, 'data'), 
            x='Age Range', y='Count',
            hue='Status', kind='bar',
            size=3.5, aspect=1.86)

)

这就是我重建节点模块并防止出现此错误的方法。