Angular-cli: Cannot find module 'buffer-shims'

Created on 14 Nov 2016  路  8Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Ubuntu 16.04.1 LTS

Versions.

angular-cli: 1.0.0-beta.19-3
node: 4.2.6
os: linux x64

Repro steps.

running npm install -g angular-cli then run ng --help

The log given by the failure.

Cannot find module 'buffer-shims'
Error: Cannot find module 'buffer-shims'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
.....

Mention any other details that might be useful.

I resolved it by running npm install -g buffer-shims, but I would assume it should be done during npm install -g angular-cli


Thanks! We'll be in touch soon.

Most helpful comment

I was stuck with this error as well and it turned out to be affiliated with node-sass.
In the end this post helped: https://github.com/sass/node-sass/issues/1991

Fix:

  1. Delete node_modules
  2. Delete package-lock.json
  3. Call the following:
npm cache clean
npm install

On npm v5+ you will need to call npm cache clean --force

All 8 comments

try

npm install -g buffer-shims

ng help

this works for me

Had the same problem, resolved with npm install -g buffer-shims but I agree. This should be part of the original setup. Maybe it's missing as a dependency?

npm install -g buffer-shims worked for me too!
thanks

make it official, npm install -g buffer-shims works!!!!

We don't require buffer-shims; webpack-dev-server and enhanced-resolve need those. There is a problem using yarn right now but npm should work fine. Closing this as WAI.

i tried
npm install -g buffer-shims
npm install buffer-shims

not works for me. it shows same error

Cannot find module 'buffer-shims'
Error: Cannot find module 'buffer-shims'

I was stuck with this error as well and it turned out to be affiliated with node-sass.
In the end this post helped: https://github.com/sass/node-sass/issues/1991

Fix:

  1. Delete node_modules
  2. Delete package-lock.json
  3. Call the following:
npm cache clean
npm install

On npm v5+ you will need to call npm cache clean --force

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings