This is my package.json for the module that I\'m including in the parent project:
{
\"version\": \"0.0.1\",
\"name\": \"module-name\",
\"d
happens with old node version. use latest version of node like this:
$ nvm use 8.0
$ rm -rf node_modules
$ npm install
$ npm i somemodule
edit: also make sure you save.
eg: npm install yourmoduleName --save
I had the same problem. But on the same machine one project had good package.json, where all my dependencies are successfully installed. And in another project my package.json dependencies were not installed no matter what i do. I just copied the package.json and pasted into that another project. And it worked! The difference i have found was only empty line at the start of file. Dont know or it influences anything, maybe some other problem. But the problem was only the package.json file.
Also check that your package name is correctly accepted:
{
"name":"My Awesome Package"
}
{
"name": "my-awesome-package-name"
}
I was receiving this error when I installed a clean Node dev environment on windows.
To fix this, I went into my new project directory (that I just scaffolded with yo angular) and typed in two commands:
npm install -g grunt --save-dev
That will install the local grunt dependencies to your project. Next:
npm install
That will ensure all your (new) project dependencies are installed.
Tada!
Just in case anyone is suffering from this predicament and happens to make the same asanine mistake that I did, here is what it was in my case. After banging my head against the wall for an hour, I realized that I had my json incorrectly nested, and the key "dependencies" was inside of the key "repository".
Needless to say, no errors were evident, and no modules were installed.
Worth to mention to make sure your dependencies should be in the dependencies part of your package.json (as opposed to devDependencies).
My issue was basically the same as OP:
repo1) via "module-name": "git+ssh://git@myserver:user/my-repo-name.git" in other repo(Let's call it repo2), repo2's node_modules, one package dependency from repo1 wasn't there.repo1 was listing that dependency in devDependencies instead of dependenciesrepo1's package.json from devDependencies to dependenciesrepo2, I removed my node_modules and package-lock.json, did npm install, an voilà!... dependency was there!