![](/img/trans.png)
[英]Is there any difference between running rm -rf node_modules + npm i vs npm ci?
[英]“npm install --save” cmd says cannot find buffer-shims after I “rm -rf node_modules && npm install”
我運行cmd rm -rf node_modules && npm install
,似乎沒有任何有趣的事情發生。 但是在那之后,當我運行npm uninstall react-native-router-flux
,它開始說它找不到模塊緩沖墊片
我發現從現在開始,每當我npm install --save something
或“ npm uninstall --save something
:它都會給出此錯誤:
node-gyp@3.6.0 should be installed with -g
> node-sass@3.13.1 install /home/raymond/IdeaProjects/puppysky/node_modules/node-sass
> node scripts/install.js
module.js:474
throw err;
^
Error: Cannot find module 'buffer-shims'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/raymond/IdeaProjects/puppysky/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js:33:18)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
看到錯誤后,我嘗試npm install --save buffer-shims
,但是它說:
npm WARN prefer global node-gyp@3.6.0 should be installed with -g
> node-sass@3.13.1 install /home/raymond/IdeaProjects/puppysky/node_modules/node-sass
> node scripts/install.js
module.js:474
throw err;
^
Error: Cannot find module 'console-control-strings'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/raymond/IdeaProjects/puppysky/node_modules/node-sass/node_modules/gauge/plumbing.js:2:22)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
看到這一點之后,我嘗試npm install --save console-control-strings
,這當然又回到了第一個問題(找不到緩沖墊片)
我試圖npm install -g buffer-shims
和npm link buffer-shims
但是它不能解決問題。
npm版本:v5.0.1,節點版本:v7.0.0
遷移到npm 5后,node-sass會發生此問題。
這些命令使它對我有用:
rm -rf node_modules
rm package-lock.json
npm cache clean
npm install
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.