Skip to content

Cannot install angular-cli #2431

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
smahanta opened this issue Sep 30, 2016 · 4 comments
Closed

Cannot install angular-cli #2431

smahanta opened this issue Sep 30, 2016 · 4 comments

Comments

@smahanta
Copy link

smahanta commented Sep 30, 2016

Please provide us with the following information:

OS?

Windows 7

Versions.

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

Error: Cannot find module 'reflect-metadata'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\@ngtools\webpack\src\index.js:5:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\models\webpack-build-typescript.js:5:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\models\webpack-config.js:2:34)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\tasks\build-webpack.js:6:24)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\commands\build.js:3:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Class.module.exports.includedCommands (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\addon\index.js:20:16)
    at C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:392:61
    at Array.forEach (native)
    at Project.addonCommands (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:391:15)
    at Project.eachAddonCommand (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\models\project.js:426:30)
    at module.exports (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\cli\lookup-command.js:33:13)
    at CLI.<anonymous> (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\lib\cli\cli.js:34:26)
    at tryCatch (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:538:12)
    at invokeCallback (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:553:13)
    at publish (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:521:7)
    at flush (C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:2370:5)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

Node version is 4.5.0

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
I was just starting out with Angular2. So first installed node(4.5.0), then typescript(2.0.3), npm(2.15.9) came bundled with node. Then tried to install angular-cli.

The log given by the failure.

C:\Users\mahantas>npm install -g angular-cli
npm WARN peerDependencies The peer dependency webpack@* included from html-webpa
ck-plugin will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerD
ependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it
explicitly.
npm WARN deprecated [email protected]: This package is deprecated. Use Object.
assign.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail o
n node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible
. Use 'npm ls graceful-fs' to find it in the tree.

> [email protected] install C:\Users\mahantas\AppData\Roaming\npm\node_modules\angu
lar-cli\node_modules\angular2-template-loader\node_modules\codecov\node_modules\
execSync
> node install.js

[execsync v1.0.2] Attempting to compile native extensions.
{ [Error: spawn node-gyp ENOENT]
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!
    Will try to use win32 extension.
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie h
ttps://nodesecurity.io/advisories/130
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
 to avoid a RegExp DoS issue

> [email protected] install C:\Users\mahantas\AppData\Roaming\npm\node_modules\a
ngular-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli
> node-pre-gyp install --fallback-to-build

[node-zopfli] Success: "C:\Users\mahantas\AppData\Roaming\npm\node_modules\angul
ar-cli\node_modules\compression-webpack-plugin\node_modules\node-zopfli\lib\bind
ing\node-v46-win32-x64\zopfli.node" is installed via remote
npm WARN optional dep failed, continuing [email protected]
npm WARN deprecated [email protected]: This package is discontinued. Use lodash@
^4.0.0.
-
> [email protected] install C:\Users\mahantas\AppData\Roaming\npm\node_modules\an
gular-cli\node_modules\node-sass
> node scripts/install.js

Start downloading binary at https://github.com/sass/node-sass/releases/download/
v3.10.0/win32-x64-46_binding.node
Binary downloaded and installed at C:\Users\mahantas\AppData\Roaming\npm\node_mo
dules\angular-cli\node_modules\node-sass\vendor\win32-x64-46\binding.node

> [email protected] postinstall C:\Users\mahantas\AppData\Roaming\npm\node_module
s\angular-cli\node_modules\node-sass
> node scripts/build.js

"C:\Users\mahantas\AppData\Roaming\npm\node_modules\angular-cli\node_modules\nod
e-sass\vendor\win32-x64-46\binding.node" exists.
 testing binary.
Binary is fine; exiting.
C:\Users\mahantas\AppData\Roaming\npm\ng -> C:\Users\mahantas\AppData\Roaming\np
m\node_modules\angular-cli\bin\ng
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its sibl
ings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants webpack@*
npm ERR! peerinvalid Peer [email protected] wants webpack@^1.1.0 || ^2 || ^2.1
.0-beta
npm ERR! peerinvalid Peer [email protected] wants webpack@^1.12.6 || ^2.1.0-beta

npm ERR! peerinvalid Peer [email protected] wants webpack@1 || 2 || ^2
.0.0-beta || ^2.1.0-beta
npm ERR! peerinvalid Peer [email protected] wants webpack@^2.1.0-b
eta

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\mahantas\npm-debug.log

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

@ghost
Copy link

ghost commented Sep 30, 2016

Duplicate issue, e.g.: #2430

You have to upgrade NPM to at least v3; v2 does not work.

@viperguynaz
Copy link

viperguynaz commented Oct 4, 2016

Same issue on Windows 10 with Node ver 6.7.0, npm ver 3.10.3, Typescript ver 2.0.3:

First got Error: Cannot find module 'reflect-metadata', fixed by running "npm install -g reflect-metadata"

Then got Error: Cannot find module 'portfinder', fixed by running " npm install -g portfinder"

@filipesilva
Copy link
Contributor

@smahanta your problem was that you were using npm2 instead of npm3, as @rolandoldengarm said.

@viperguynaz see #1782

@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

3 participants