npm 踩坑

环境

系统: Centos7

程序版本: Node.js version 10.16.0

踩坑经历一

  • gyp ERR! configure error

    gyp ERR! stack Error: EACCES: permission denied

    解决办法:

    1
    npm install --unsafe-perm=true --allow-root
  • gyp ERR! stack Error: gyp failed with exit code: 1

    1
    2
    3
    4
    rm -rf ~/.node-gyp
    npm i -g node-gyp
    rm -rf <project>/node_modules
    npm i -d

Reference

npm node-gyp rebuild-error

0%