Friday 2 June 2017

"npm install --save" cmd says cannot find buffer-shims after I "rm -rf node_modules && npm install"

I run cmd rm -rf node_modules && npm install, it seems nothing interesting happens. But after that, when I run npm uninstall react-native-router-flux, it starts to say it cannot find module buffer-shims

I found that from now on whenever I npm install --save something or "npm uninstall --save something: it gives this error:

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)

After seeing the error, I try to npm install --save buffer-shims, but it says:

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)

After seeing this, I try to npm install --save console-control-strings, which of course goes back to the first problem again (cannot find buffer-shims)

I have tried to npm install -g buffer-shims and npm link buffer-shims but it does not solve the problem.

npm version: v5.0.1, node version: v7.0.0



via Raymond Pang

No comments:

Post a Comment