node異常問題解決

報錯日誌如下

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/data/blockscout/apps/block_scout_web/assets/node_modules/node-sass/.node-gyp'
gyp ERR! System Linux 3.10.0-1062.9.1.el7.x86_64
gyp ERR! command "/usr/local/bin/node" "/data/blockscout/apps/block_scout_web/assets/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /data/blockscout/apps/block_scout_web/assets/node_modules/node-sass
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN [email protected] requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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!     /root/.npm/_logs/2020-03-24T03_28_45_196Z-debug.log

解決辦法

npm install --unsafe-perm

cnpm 安裝

npm install -g cnpm --registry=https://registry.npm.taobao.org

系統異常導致編譯失敗

service systemd-resolved restart

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章