0
私が取り組んでいるプロジェクトでnpm installを実行しているときに問題が発生しています。npm installは永遠にループし続ける
npm installコマンドが(手動で強制終了されるまで)常に再実行されているようです。奇妙なことは、最初のnpmのインストール後にすべての依存関係がインストールされ、正常に動作することです。これは、いくつかのCIツールを使用して自分のコードを自動構築しようとするときに問題になっています。
私は以下の条件でこれをテストしました。
- のWindows OS
- のLinux OS
- 様々なノード/ NPMバージョン(6.xおよび8.xのブランチ)のみの単一の依存関係の簡単なpackage.jsonで
- 。
- クリアNPMキャッシュを現在使用してノード/ NPMの
バージョン。
- ノード:v6.11.5
- NPM:3.10.10
シンプルpackage.jsonの問題を示しています。
{
"name": "tool",
"version": "1.0.0",
"author": "Jeff",
"description": "A starter project",
"repository": {},
"license": "UNLICENSED",
"contributors": [],
"keywords": [],
"dependencies": {
"@angular/common": "4.4.6"
},
"devDependencies": {
},
"scripts": {
"install": "npm install",
"serve-dev": "ng serve --host 0.0.0.0",
"serve-prod": "ng serve --prod --host 0.0.0.0",
"build-dev": "ng build",
"build-prod": "ng build --prod"
}
}
NPMインストールログ:
npm -dd install
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', '-dd', 'install' ]
npm info using [email protected]
npm info using [email protected]
npm verb mapToRegistry no registry URL found in name for scope @angular
npm verb request uri https://registry.npmjs.org/@angular%2fcommon
npm verb request no auth needed
npm info attempt registry request try #1 at 3:41:11 PM
npm verb request id 10054e4c6c4b8242
npm verb etag W/"59f29d79-234ca"
npm verb lastModified Fri, 27 Oct 2017 02:44:09 GMT
npm http request GET https://registry.npmjs.org/@angular%2fcommon
npm http 304 https://registry.npmjs.org/@angular%2fcommon
npm verb headers { date: 'Fri, 27 Oct 2017 23:41:13 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=0',
npm verb headers etag: 'W/"59f29d79-234ca"',
npm verb headers age: '0',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-mdw17339-MDW',
npm verb headers 'x-cache': 'MISS',
npm verb headers 'x-cache-hits': '0',
npm verb headers 'x-timer': 'S1509147674.967823,VS0,VE358',
npm verb headers vary: 'Accept-Encoding' }
npm verb etag https://registry.npmjs.org/@angular%2fcommon from cache
npm verb get saving @angular/common to /home/jeff/.npm/registry.npmjs.org/_40angular_252fcommon/.cache.json
npm verb correctMkdir /home/jeff/.npm correctMkdir not in flight; initializing
npm verb cache add spec @angular/[email protected]
npm verb addNamed "4.4.6" is a plain semver version for @angular/common
npm verb mapToRegistry no registry URL found in name for scope @angular
npm verb addNameVersion registry:https://registry.npmjs.org/@angular%2fcommon not in flight; fetching
npm verb get https://registry.npmjs.org/@angular%2fcommon not expired, no request
npm verb afterAdd /home/jeff/.npm/@angular/common/4.4.6/package/package.json not in flight; writing
npm verb correctMkdir /home/jeff/.npm correctMkdir not in flight; initializing
npm verb afterAdd /home/jeff/.npm/@angular/common/4.4.6/package/package.json written
npm verb request uri https://registry.npmjs.org/tslib
npm verb request no auth needed
npm info attempt registry request try #1 at 3:41:14 PM
npm verb etag W/"59dd9f6d-4c68"
npm verb lastModified Wed, 11 Oct 2017 04:34:53 GMT
npm http request GET https://registry.npmjs.org/tslib
npm http 304 https://registry.npmjs.org/tslib
npm verb headers { date: 'Fri, 27 Oct 2017 23:41:15 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: 'W/"59dd9f6d-4c68"',
npm verb headers age: '172',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-mdw17339-MDW',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '1',
npm verb headers 'x-timer': 'S1509147675.077783,VS0,VE0',
npm verb headers vary: 'Accept-Encoding, Accept' }
npm verb etag https://registry.npmjs.org/tslib from cache
npm verb get saving tslib to /home/jeff/.npm/registry.npmjs.org/tslib/.cache.json
npm verb correctMkdir /home/jeff/.npm correctMkdir not in flight; initializing
npm verb cache add spec [email protected]^1.7.1
npm verb addNamed ">=1.7.1 <2.0.0" is a valid semver range for tslib
npm verb addNameRange registry:https://registry.npmjs.org/tslib not in flight; fetching
npm verb get https://registry.npmjs.org/tslib not expired, no request
npm verb addNamed "1.8.0" is a plain semver version for tslib
npm verb afterAdd /home/jeff/.npm/tslib/1.8.0/package/package.json not in flight; writing
npm verb correctMkdir /home/jeff/.npm correctMkdir not in flight; initializing
npm verb afterAdd /home/jeff/.npm/tslib/1.8.0/package/package.json written
npm info lifecycle [email protected]~preinstall: [email protected]
npm verb correctMkdir /home/jeff/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm verb unbuild node_modules/.staging/@angular/common-b1bc935a
npm verb unbuild node_modules/.staging/tslib-34a2ed6e
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/@angular/common-b1bc935a
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/tslib-34a2ed6e
npm verb tar unpack /home/jeff/.npm/@angular/common/4.4.6/package.tgz
npm verb tar unpacking to /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/@angular/common-b1bc935a
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/@angular/common-b1bc935a
npm verb tar unpack /home/jeff/.npm/tslib/1.8.0/package.tgz
npm verb tar unpacking to /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/tslib-34a2ed6e
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/tslib-34a2ed6e
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/tslib-34a2ed6e/node_modules
npm verb gentlyRm don't care about contents; nuking /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging/@angular/common-b1bc935a/node_modules
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle @angular/[email protected]~preinstall: @angular/[email protected]
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info linkStuff @angular/[email protected]
npm verb linkBins @angular/[email protected]
npm verb linkMans @angular/[email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle @angular/[email protected]~install: @angular/[email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle @angular/[email protected]~postinstall: @angular/[email protected]
npm verb unlock done using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info lifecycle [email protected]~install: [email protected]
> [email protected] install /mnt/c/work/personal/LiveXSLTransformUI/tmp
> npm install
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm verb correctMkdir /home/jeff/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm verb unlock done using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info lifecycle [email protected]~install: [email protected]
> [email protected] install /mnt/c/work/personal/LiveXSLTransformUI/tmp
> npm install
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm verb correctMkdir /home/jeff/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm verb unlock done using /home/jeff/.npm/_locks/staging-950641377131bc6f.lock for /mnt/c/work/personal/LiveXSLTransformUI/tmp/node_modules/.staging
npm info linkStuff [email protected]
npm verb linkBins [email protected]
npm verb linkMans [email protected]
npm info lifecycle [email protected]~install: [email protected]
を
npm 5.5.1がリリースされました。多分それはアップグレードのための時間です(?)。 –
私は5.5.1を試しましたが、同じ問題が続く。私が使用しているバージョンを使用する理由は、インストールしたnode.jsのバージョンが付属しているからです。 – Jeff
package.jsonのscriptsセクションから 'install'行を削除した後です。 –