下面有package.json
。
{
"name": "test",
"version": "0.0.0",
"license": "MIT",
"devDependencies": {
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0"
}
}
执行npm install
后,处理结束于中间,如下所示,并且不会显示错误。
c:\test>npm install --loglevel=verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--loglevel=verbose' ]
npm info using npm@5.6.0
npm info using node@v8.10.0
npm verb npm-session f1e5e2cf3695876a
npm info lifecycle test@0.0.0~preinstall: test@0.0.0
npm http fetch GET 200 https://registry.npmjs.org/@types%2fjasminewd2 767ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2frouter 779ms
npm http fetch GET 200 https://registry.npmjs.org/@types%2fjasmine 784ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2fcore 803ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2fhttp 825ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2fforms 837ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2fplatform-browser-dynamic 846ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2fplatform-browser 858ms
npm http fetch GET 200 https://registry.npmjs.org/@ng-bootstrap%2fng-bootstrap 864ms
npm http fetch GET 200 https://registry.npmjs.org/@angular%2flanguage-service 882ms
npm http fetch GET 200 https://registry.npmjs.org/tslib 133ms
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode 892ms
npm verb correctMkdir C:\Users\xxxxx\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\xxxxx\AppData\Roaming\npm-cache\_locks\staging-07886ea4c957ccb4.lock for c:\test\node_modules\.staging
npm http fetch GET 200 https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz 170ms
npm http fetch GET 200 https://registry.npmjs.org/@types/jasmine/-/jasmine-2.8.6.tgz 312ms
npm http fetch GET 200 https://registry.npmjs.org/@types/jasminewd2/-/jasminewd2-2.0.3.tgz 721ms
npm http fetch GET 200 https://registry.npmjs.org/@types/node/-/node-6.0.103.tgz 863ms
c:\test>
之后重复npm install
几次以成功完成。
c:\test>npm install --loglevel=verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--loglevel=verbose' ]
npm info using npm@5.6.0
npm info using node@v8.10.0
npm verb npm-session 6156e805bb2b7ef7
npm info lifecycle test@0.0.0~preinstall: test@0.0.0
npm http fetch GET 304 https://registry.npmjs.org/@angular%2fplatform-browser-dynamic 390ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2fcore 424ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2fforms 430ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tslib 162ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@ng-bootstrap%2fng-bootstrap 740ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2frouter 759ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fjasminewd2 776ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2fhttp 797ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2fplatform-browser 804ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fjasmine 837ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@angular%2flanguage-service 849ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fnode 668ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fjasmine 305ms (from cache)
npm verb correctMkdir C:\Users\xxxxx\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb lock using C:\Users\xxxxx\AppData\Roaming\npm-cache\_locks\staging-07886ea4c957ccb4.lock for c:\test\node_modules\.staging
npm info lifecycle @types/jasmine@2.8.6~preinstall: @types/jasmine@2.8.6
npm info lifecycle tslib@1.9.0~preinstall: tslib@1.9.0
npm info lifecycle @angular/core@5.2.9~preinstall: @angular/core@5.2.9
npm info lifecycle @angular/forms@5.2.9~preinstall: @angular/forms@5.2.9
npm info lifecycle @angular/http@5.2.9~preinstall: @angular/http@5.2.9
npm info lifecycle @angular/language-service@5.2.9~preinstall: @angular/language-service@5.2.9
npm info lifecycle @angular/platform-browser@5.2.9~preinstall: @angular/platform-browser@5.2.9
npm info lifecycle @angular/platform-browser-dynamic@5.2.9~preinstall: @angular/platform-browser-dynamic@5.2.9
npm info lifecycle @angular/router@5.2.9~preinstall: @angular/router@5.2.9
npm info lifecycle @ng-bootstrap/ng-bootstrap@1.0.4~preinstall: @ng-bootstrap/ng-bootstrap@1.0.4
npm info lifecycle @types/jasminewd2@2.0.3~preinstall: @types/jasminewd2@2.0.3
npm info lifecycle @types/node@6.0.103~preinstall: @types/node@6.0.103
npm info linkStuff @types/jasmine@2.8.6
npm verb linkBins @types/jasmine@2.8.6
npm verb linkMans @types/jasmine@2.8.6
npm info linkStuff tslib@1.9.0
npm verb linkBins tslib@1.9.0
npm verb linkMans tslib@1.9.0
npm info linkStuff @angular/core@5.2.9
npm verb linkBins @angular/core@5.2.9
npm verb linkMans @angular/core@5.2.9
npm info linkStuff @angular/forms@5.2.9
npm verb linkBins @angular/forms@5.2.9
npm verb linkMans @angular/forms@5.2.9
npm info linkStuff @angular/http@5.2.9
npm verb linkBins @angular/http@5.2.9
npm verb linkMans @angular/http@5.2.9
npm info linkStuff @angular/language-service@5.2.9
npm verb linkBins @angular/language-service@5.2.9
npm verb linkMans @angular/language-service@5.2.9
npm info linkStuff @angular/platform-browser@5.2.9
npm verb linkBins @angular/platform-browser@5.2.9
npm verb linkMans @angular/platform-browser@5.2.9
npm info linkStuff @angular/platform-browser-dynamic@5.2.9
npm verb linkBins @angular/platform-browser-dynamic@5.2.9
npm verb linkMans @angular/platform-browser-dynamic@5.2.9
npm info linkStuff @angular/router@5.2.9
npm verb linkBins @angular/router@5.2.9
npm verb linkMans @angular/router@5.2.9
npm info linkStuff @ng-bootstrap/ng-bootstrap@1.0.4
npm verb linkBins @ng-bootstrap/ng-bootstrap@1.0.4
npm verb linkMans @ng-bootstrap/ng-bootstrap@1.0.4
npm info linkStuff @types/jasminewd2@2.0.3
npm verb linkBins @types/jasminewd2@2.0.3
npm verb linkMans @types/jasminewd2@2.0.3
npm info linkStuff @types/node@6.0.103
npm verb linkBins @types/node@6.0.103
npm verb linkMans @types/node@6.0.103
npm info lifecycle @types/jasmine@2.8.6~install: @types/jasmine@2.8.6
npm info lifecycle tslib@1.9.0~install: tslib@1.9.0
npm info lifecycle @angular/core@5.2.9~install: @angular/core@5.2.9
npm info lifecycle @angular/forms@5.2.9~install: @angular/forms@5.2.9
npm info lifecycle @angular/http@5.2.9~install: @angular/http@5.2.9
npm info lifecycle @angular/language-service@5.2.9~install: @angular/language-service@5.2.9
npm info lifecycle @angular/platform-browser@5.2.9~install: @angular/platform-browser@5.2.9
npm info lifecycle @angular/platform-browser-dynamic@5.2.9~install: @angular/platform-browser-dynamic@5.2.9
npm info lifecycle @angular/router@5.2.9~install: @angular/router@5.2.9
npm info lifecycle @ng-bootstrap/ng-bootstrap@1.0.4~install: @ng-bootstrap/ng-bootstrap@1.0.4
npm info lifecycle @types/jasminewd2@2.0.3~install: @types/jasminewd2@2.0.3
npm info lifecycle @types/node@6.0.103~install: @types/node@6.0.103
npm info lifecycle @types/jasmine@2.8.6~postinstall: @types/jasmine@2.8.6
npm info lifecycle tslib@1.9.0~postinstall: tslib@1.9.0
npm info lifecycle @angular/core@5.2.9~postinstall: @angular/core@5.2.9
npm info lifecycle @angular/forms@5.2.9~postinstall: @angular/forms@5.2.9
npm info lifecycle @angular/http@5.2.9~postinstall: @angular/http@5.2.9
npm info lifecycle @angular/language-service@5.2.9~postinstall: @angular/language-service@5.2.9
npm info lifecycle @angular/platform-browser@5.2.9~postinstall: @angular/platform-browser@5.2.9
npm info lifecycle @angular/platform-browser-dynamic@5.2.9~postinstall: @angular/platform-browser-dynamic@5.2.9
npm info lifecycle @angular/router@5.2.9~postinstall: @angular/router@5.2.9
npm info lifecycle @ng-bootstrap/ng-bootstrap@1.0.4~postinstall: @ng-bootstrap/ng-bootstrap@1.0.4
npm info lifecycle @types/jasminewd2@2.0.3~postinstall: @types/jasminewd2@2.0.3
npm info lifecycle @types/node@6.0.103~postinstall: @types/node@6.0.103
npm verb unlock done using C:\Users\xxxxx\AppData\Roaming\npm-cache\_locks\staging-07886ea4c957ccb4.lock for c:\test\node_modules\.staging
npm info linkStuff test@0.0.0
npm verb linkBins test@0.0.0
npm verb linkMans test@0.0.0
npm info lifecycle test@0.0.0~install: test@0.0.0
npm info lifecycle test@0.0.0~postinstall: test@0.0.0
npm info lifecycle test@0.0.0~prepublish: test@0.0.0
npm info lifecycle test@0.0.0~prepare: test@0.0.0
npm verb saving []
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm notice created a lockfile as package-lock.json. You should commit this file.
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN @angular/core@5.2.9 requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/core@5.2.9 requires a peer of zone.js@^0.8.4 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@5.2.9 requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@5.2.9 requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@5.2.9 requires a peer of @angular/common@5.2.9 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@5.2.9 requires a peer of @angular/common@5.2.9 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@5.2.9 requires a peer of @angular/compiler@5.2.9 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser@5.2.9 requires a peer of @angular/common@5.2.9 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@5.2.9 requires a peer of @angular/common@5.2.9 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/router@5.2.9 requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ng-bootstrap/ng-bootstrap@1.0.4 requires a peer of @angular/common@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN test@0.0.0 No description
npm WARN test@0.0.0 No repository field.
added 12 packages in 4.842s
npm verb exit [ 0, true ]
npm info ok
c:\test>
我的环境如下。
在连接到同一网络的同事的环境中不会发生这种情况。
(我们正在同事环境中进行验证npm cache clean
和rm - rf node_modules
。
此外,由于它连接到同一网络,似乎它不是网络相关的现象。 )
yarn
,但发生了类似事件。是否还有其他人遇到类似事件?
如果你能告诉我如何处理这个案子,我会很高兴的。
此致
答案 0 :(得分:0)
前几天我遇到了类似的问题,而且我的RAM内存耗尽了。尝试升级内存或释放一些空间并重新安装节点模块!!