Cannot find module '@ngtools/json-schema'
Bug Report or Feature Request (mark with an x)
- [X ] bug report -> please search issues before submitting
- [ ] feature request
Versions.
1.1.3.
Repro steps.
npm install -g @angular/cli ng help
The log given by the failure.
Error: Cannot find module '@ngtools/json-schema'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.
Desired functionality.
Work.
Mention any other details that might be useful.
Windows 10
I can't reproduce this myself. You might have a broken npm install somewhere. If there's something else you can tell me to reproduce this, I might be able to look into it.
I also found almost same issue on Windows 7/Node v8.1.2/npm v5.0.3/Angular CLI 1.1.1. The issue I found happens on local installed Angular CLI, which can be run by .\node_modules\.bin\ng.
Actually I have three Windows PC and only one of them has the problem. Moreover, after copying whole node_modules directory of the PC without the problem to the PC with the problem, .\node_modules\.bin\ng command works correctly even on the PC with the problem. I have not figured out differences between them right now, but I assume that npm install might have some issues on the Windows platform with specific conditions.
I have same issues but on mac. I tried on windows and it works fine. Node 8.0.0, npm 5.0.0, angular-cli 1.0.0
Edit: I completely remove node and npm and install it again, and it works.
I had this very same issue and I noticed that somehow I ended up with two different versions of @angular/compiler-cli on my package.json, one in dependencies and the other in devDependencies. Removing the outdated version fixed the issue after reinstalling.
Seems like it's a dependency problem then.
Installing the package and adding it to my package.json file solved it for me.
None of the above worked for me. I cleaned npm and npm cache in appdata\roaming, and uninstalled and reinstalled node to no avail. Finally got it working now and the solution for me was to ALSO delete everything in the c:\program files\nodejs\ folder. I just for the sake of it also installed it to a new folder called node. After that it started working again and npm i -g @angular/cli did not provide errors, back to normal again.
I uninstalled and installed node/npm/angular-cli many times. Finally did a "where ng" on my windows pc, and found the executable was under the %appdata%\npm directory. So after uninstalling node, deleting the %appdata%\npm directory, reinstalling node, and 'npm install -g angular-cli', the ng new and ng serve commands started working.
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.