Skip to content

buffer-shims problem in subdirectory of home #3215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
madoar opened this issue Nov 21, 2016 · 8 comments
Closed

buffer-shims problem in subdirectory of home #3215

madoar opened this issue Nov 21, 2016 · 8 comments

Comments

@madoar
Copy link

madoar commented Nov 21, 2016

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Linux Mint 18

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

marc@marc-ThinkPad-X1-Carbon ~ $ ng --version
angular-cli: 1.0.0-beta.20-4
node: 4.2.6
os: linux x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Yes, the app was created through the CLI via the WebStorm IDE.
I did no changes to it, it was just newly created as an angular cli project.

The log given by the failure.

Normally this include a stack trace and some more information.

marc@marc-ThinkPad-X1-Carbon ~/WebstormProjects/AngularTest $ ng serve
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)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/readable-stream/lib/_stream_readable.js:40:18)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/readable-stream/readable.js:6:28)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/memory-fs/lib/MemoryFileSystem.js:8:14)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/webpack-dev-middleware/middleware.js:5:24)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/webpack-dev-server/lib/Server.js:4:28)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/tasks/serve-webpack.js:8:24)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/commands/serve.js:7:23)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Class.module.exports.includedCommands (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/addon/index.js:22:16)
at /home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/angular-cli/lib/models/project.js:392:61
at Array.forEach (native)
at Project.addonCommands (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/angular-cli/lib/models/project.js:391:15)
at Project.eachAddonCommand (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/angular-cli/lib/models/project.js:426:30)
at module.exports (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/angular-cli/lib/cli/lookup-command.js:33:13)
at CLI. (/home/marc/WebstormProjects/AngularTest/node_modules/angular-cli/angular-cli/lib/cli/cli.js:34:26)
at tryCatch (/home/marc/WebstormProjects/AngularTest/node_modules/rsvp/dist/lib/rsvp/-internal.js:215:12)
at invokeCallback (/home/marc/WebstormProjects/AngularTest/node_modules/rsvp/dist/lib/rsvp/-internal.js:230:13)
at publish (/home/marc/WebstormProjects/AngularTest/node_modules/rsvp/dist/lib/rsvp/-internal.js:198:7)
at flush (/home/marc/WebstormProjects/AngularTest/node_modules/rsvp/dist/lib/rsvp/asap.js:85:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)

Mention any other details that might be useful.

Like you see in the given console results I've executed ng --version in my home directory while I've executed ng serve in the project directory.
Directly after installing angular cli I got the same error as I get now for ng serve for executing ng help.
I solved this by following the steps in #3131 by executing: npm install -g buffer-shims
But the error still occurs if I execute an ng command in another directory like you see when looking at my error stack.

Just as a note:
I've also submitted issue #3214 where I've reported the problems I occured when installing angular cli. Not sure if this my be associated with this issue.

@Destreyf
Copy link

@madoar ng serve is failing because a dependency is not installed most likely due to node-zopfli failing to install from your installation as mentioned in #3214.

running npm install -g buffer-shims results in a global install of the buffer-shims, you could in theory do a npm install buffer-shims inside of your project and see if that fixes it (note the -g is missing) but the real issue is that certain elements are failing to install in the initial npm install when creating a new project.

@madoar
Copy link
Author

madoar commented Nov 21, 2016

After following what you've written in #3214 I still get the same error for this issue.

After locally installing buffer-shims via npm i buffer-shims it seems like I'm able to serve the test application via ng serve.
But it appears that I'm compiling node-zopfli again when installing buffer-shims.

@Destreyf
Copy link

as referenced in #3214 you'll need to probably delete your node_modules directory in your project and perform npm install in the root of your project to make sure that there's no broken modules from when the node-zopfli didn't install.

@madoar
Copy link
Author

madoar commented Nov 21, 2016

Thanks alot.
I just deleted the node_modules folder and executed npm install. Afterwards the test application could be started without any trouble.

@filipesilva
Copy link
Contributor

Closing because it seems solved.

@LamShuiYing
Copy link

madoar what steps you needed to solve Installation error #3214?
error installing angular2 quickstart

@madoar
Copy link
Author

madoar commented Feb 12, 2017

@LamShuiYing I solved issue #3214 by installing build-essential and g++ (take a look at the post of Destreyf). I think, that this shouldn't be an issue anymore, because zopfli was removed from newer angular-cli versions, as far as I remember the changelog.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants