-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Error: Cannot find module 'portfinder' when doing any ng commands #1782
Comments
I can't reproduce this on Windows 10 myself. It looks like your install is missing a package, which can be the result of a broken install or of a NPM upgrade without reinstall. This should work if that's the case, but you say you've tried it already:
I'll leave the issue open in case there's a way to repro this I can use to debug. |
Same Problem here. If i run any ng command outside a cli Project it works fine. $ ng v History: npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm ERR! enoent ENOENT: no such file or directory, rename 'd:\workspace\DomainJumper\GUI\node_modules.staging\abbrev-7e384210' -> 'd:\workspace\DomainJumper\GUI\node_modules\ember-cli\node_modules\npm\node_modules\abbrev' npm ERR! Please include the following file with any support request: When i run: module.js:327 Error: Cannot find module 'semver' hmmpf package.json says:
Why???? I Change it to ng version works now ERROR in ./src/main.ts ERROR in ./src/polyfills.ts run ng init |
I am seeing the same or similar problem on mac. I have attached the npm debug file |
I found (for me) followed solution: clone project i find out that you need node v4.x to get it work, (had this problem with a team member) regards |
So I had this same issue during a project upgrade and resolved by going through a few hoops...
|
@bbohling Did something similar to what you suggested, as I don't even have a project created yet since I cannot run any commands. I went to where my angular-cli was installed globally, appdata/roaming/npm/node_modules, and ran npm install there. Unfortunately I still get the above npm install errors and the portfinder error outlined in the images of my previous comment... |
Sorry @zjkipping I should have explicitly stated that I navigated not to the global angular-cli instance, but my local (project) instance. |
I got the same problem and I solved the issue for me by going to my angular-cli folder and installing portfinder there with I can reproduce this by wiping angular-cli or node modules and reinstalling |
If a local |
Thank @retallicka and @jodytate for the very helpful answers. This seems to have done the trick for me. I can now run ng perfectly fine outside of another older angular-cli webpack project. I believe this problem is just that I am now on a newer version of the cli (beta.11-webpack.8) vs when I created it in the early days of beta.11-webpack.2. I'll go ahead and close this since my issues have been resolved. |
Worked for me thanks 👍 |
@retallicka @jodytate followed both steps, but doesn't works on my MAC |
@jodytate |
Please install those dependence manually such as reflect-metadata and portfinder globally. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I am currently using Windows 10 on this device, same as my laptop which doesn't seem to be having issues with the cli. I also have npm version 3.10.6 and nodejs version 6.4.0. I am running the command prompt in Administrator mode if that's makes a difference.
Regrettably like stated in the title I cannot run any angular-cli commands without the error, including "--version", but I did install angular-cli@webpack with npm. I also haven't started creating an app yet on this device due to this error.
Log from command prompt: (same error on everything command)
I have tried solutions from these: Angular2 : Need to create angular2 folder structure using latest angularCLI Webpack
and Error: Cannot find module 'portfinder' with Webpack release and NPM 2 #1770 with no success and cannot seem to find anything else about this on google. Unlike the latter link, I do not care what version of npm I am using.
The text was updated successfully, but these errors were encountered: