Skip to content

ng install fails with missing module #185

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
filipesilva opened this issue Feb 10, 2016 · 10 comments
Closed

ng install fails with missing module #185

filipesilva opened this issue Feb 10, 2016 · 10 comments

Comments

@filipesilva
Copy link
Contributor

Using the latest master, and trying to install angularfire2 yields the following result:

filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/dev/ideablade/testing/testproj4 (master)
$ ng install angularfire2
Cannot find module 'npm'
Error: Cannot find module 'npm'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Class.module.exports.Task.extend.init (E:\dev\ideablade\angular-cli\addon\ng2\tasks\lib-install.js:22:28)
    at new Class (E:\dev\ideablade\angular-cli\node_modules\angular-cli\node_modules\core-object\core-object.js:18:12)
    at Class.module.exports.Command.extend.run (E:\dev\ideablade\angular-cli\addon\ng2\commands\install.js:24:26)
    at Class.<anonymous> (E:\dev\ideablade\angular-cli\node_modules\angular-cli\lib\models\command.js:151:17)
    at lib$rsvp$$internal$$tryCatch (E:\dev\ideablade\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (E:\dev\ideablade\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:505:17)

I tried to simply do npm install npm on my angular-cli install, but that changes the error to something else that doesn't look much better.

The issue seems to be related with this line.

/cc @jkuri @NathanWalker @jeffbcross

Edit: running ng install ng2-cli-test-lib yields the same results.

@jkuri
Copy link
Contributor

jkuri commented Feb 10, 2016

@filipesilva try npm link npm. This is sometimes happening on Windows. If npm linking doesn't work and you find a solution maybe please post it. I can try on VM Win7 tomorrow.

@filipesilva
Copy link
Contributor Author

Roger, that solves it. I'll look into a more permanent solution for this tomorrow.

Thanks for the super fast response btw!

@jeffbcross
Copy link
Contributor

@filipesilva are you on Windows or Mac? npm link npm didn't solve my issue on Mac.

@filipesilva
Copy link
Contributor Author

I am on windows, but although @jkuri 's fix resolved my issue with ng2-cli-test-lib, I am getting another, different issue with angularfire2

filipe.silva@DESKTOP-7ND6T3R MINGW64 /e/dev/ideablade/testing/testproj4 (master)
$ ng install angularfire2
Installing 3rd party package: angularfire2...
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0
npm WARN peerDependencies The peer dependency [email protected] included from angular2 will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

-> running install

>> written zero files
npm WARN unmet dependency E:\dev\ideablade\testing\testproj4\node_modules\angular-cli\node_modules\mocha\node_modules\glob requires minimatch@'~0.2.11' but will load
npm WARN unmet dependency E:\dev\ideablade\testing\testproj4\node_modules\angular-cli\node_modules\minimatch,
npm WARN unmet dependency which is version 2.0.10
Removing packages which were not recognized as authentic: angularfire2
No package to process. Quitting.
Done.

It seems related with this check. It seems to be enforcing the bundling step in the docs.

@jeffbcross
Copy link
Contributor

I think the peer deps warnings aren't causing any issues.

The real issue appears to be these lines: https://github.com/angular/angular-cli/blob/master/addon/ng2/tasks/lib-install.js#L563

Those lines are checking if my package contains angularfire2.ts, and bundles/angularfire2.ts, which the project doesn't contain.

@jkuri
Copy link
Contributor

jkuri commented Feb 10, 2016

@jeffbcross try setting the correct $NODE_PATH on Mac.
SystemJS bundles are needed for this to work, also angularfire2.ts should export default var and correlated directives/pipes/... Please check the link @filipesilva provided to make package authentic with this command.

Edit: ng2-cli-test-lib is a good example exporting everything possible

@jkuri
Copy link
Contributor

jkuri commented Feb 10, 2016

I can also provide a PR for this library to make package authentic if it will be needed.

@jeffbcross
Copy link
Contributor

I'll close this issue since the original issue is resolved. I opened #188 and #189 as follow-ups.

@jeffbcross
Copy link
Contributor

Thanks for the help @jkuri and @filipesilva!

@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 5, 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