Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm can't install any packages

Tags:

node.js

I need some help because i can't install any npm packages. When i try to install something i get this error.

enter image description here

My node version is 6.11.0 and npm version is 3.10.10.

npm-debug.log :

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'server:dev',
1 verbose cli   '--',
1 verbose cli   '--hot',
1 verbose cli   '--proxy-requests' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: server:dev
4 verbose stack     at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:151:19)
4 verbose stack     at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:61:5
4 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:356:5
4 verbose stack     at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:320:45)
4 verbose stack     at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:354:3)
4 verbose stack     at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:124:5)
4 verbose stack     at ReadFileContext.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:295:20)
4 verbose stack     at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:366:13)
5 verbose cwd C:\Users\Scyli\Desktop\angular
6 error Windows_NT 10.0.14393
7 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "server:dev" "--" "--hot" "--proxy-requests"
8 error node v6.11.0
9 error npm  v3.10.10
10 error missing script: server:dev
11 error If you need help, you may report this error at:
11 error     <https://github.com/npm/npm/issues>
12 verbose exit [ 1, true ]

Please help me solve this problem.

like image 805
Dóczi Szilárd Avatar asked Jun 10 '17 10:06

Dóczi Szilárd


4 Answers

I was getting leaf signature err,so i solved it by: //first type this

npm config set strict-ssl false

//and then

npm config set NODE_TLS_REJECT_UNAUTHORIZED 0

and after that try to install the packages.

like image 146
Ghanshyam Bendkoli Avatar answered Oct 16 '22 03:10

Ghanshyam Bendkoli


Solved: 32-bit NodeJs completely solved my problem.

like image 5
Dóczi Szilárd Avatar answered Oct 21 '22 08:10

Dóczi Szilárd


This commands solve same problem

npm install -g npm
npm cache clean
npm update
npm install
like image 5
Andrey.Kostyuchenko Avatar answered Oct 21 '22 07:10

Andrey.Kostyuchenko


I tried many different suggestions finding a solution. For reference: I'm working in Goorm online IDE.

In the end, simply reinstalling npm in the root directory did the trick. I ran:

sudo npm install npm -g

and afterwards I was able to install packages as normal again.

like image 5
Govert Tieleman Avatar answered Oct 21 '22 07:10

Govert Tieleman