2017-09-24 194 views
1

安裝節點檢查的特性「暫停」下NPM 5.3.0node-inspector安裝失敗:npm ERR!無法讀取未定義

[email protected]:~$ sudo npm install -g node-inspector 
> [email protected] preinstall /usr/local/lib/node_modules/node-inspector/node_modules/v8-profiler 
> node -e 'process.exit(0)' 

npm ERR! Cannot read property 'pause' of undefined 

npm ERR! A complete log of this run can be found in: 
npm ERR!  /home/eric/.npm/_logs/2017-09-24T09_34_28_089Z-debug.log 

這可能與npm ERR! Cannot read property 'pause' of undefined --Bluemix失敗。

回答

2

每四周npm issue 16677線程,可以明顯地去除~/.npm,雖然npm cache verify(無根必要的訪問)顯得更優雅:

[email protected]:~$ npm cache verify 
Cache verified and compressed (~/.npm/_cacache): 
Content verified: 1077 (29065069 bytes) 
Content garbage-collected: 15 (201214 bytes) 
Index entries: 1442 
Finished in 1.482s 
[email protected]:~$ sudo npm install -g node-inspector 
/usr/local/bin/node-inspector -> /usr/local/lib/node_modules/node-inspector/bin/inspector.js 
/usr/local/bin/node-debug -> /usr/local/lib/node_modules/node-inspector/bin/node-debug.js 
+ [email protected] 
updated 1 package in 9.692s