I installed node.js + npm from https://nodejs.org/en/
and created a folder for project and cd into it (OS: Windows 10). When i try
C:\nodejs\demo>npm install express@3.5.0
npm starts to delete the all standart packages and after the process of installation I see that it deleted 460 packages and installed 1-express (express is just an example, the same thing happens with any package I tried to install).
npm WARN saveError ENOENT: no such file or directory, open 'C:\nodejs\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\nodejs\package.json'
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.
+ express@3.5.0
removed 460 packages and updated 1 package in 8.63s
And there npm stops working, if I try npm -v
I see the following:
module.js:538
throw err;
^
Error: Cannot find module 'C:\nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
module.js:538
throw err;
^
Error: Cannot find module 'C:\nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
I don't know if it's important, but after the installation of node.js I had to add it into PATH variable by myself.
Could someone explain me what I did wrong or how I can fix this, please?