いくつかの同期コマンドにnpmスクリプトが設定されています。開始コマンドはnpm run clean:install"
です。ここでNPM rimraf - フォルダがないときに実行を続行します(終了コード1を停止します)。
は配列であるすべてのディレクトリが存在する場合
"install:all": "npm install && bower install", "clean": "npm run rimraf -- node_modules doc typings coverage wwwroot bower_components" "preclean:install": "npm run clean", "clean:install": "npm set progress=false && npm run install:all"
が正常に動作します。問題は、いずれかのディレクトリが既に削除されている場合、スクリプトはコード1で存在し、追加の同期スクリプトが実行されないようにすることです。
だから、それはそれはきれいなの元のコマンドを実行するfailes意味:最後の行がそれを離れて与え
npm ERR! [email protected] clean: `npm cache clean && npm run
rimraf -- node_modules doc typings coverage wwwroot bower_components`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] clean script 'npm cache clean && npm run rimraf -- node_modules doc typings coverage wwwroot bower_components'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm cache clean && npm run rimraf -- node_modules doc typings coverage wwwroot bower_components
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-webpack-starter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
:NPMから「"clean:install": "npm set progress=false && npm run install:all
」
エラーであるインストールします。それはnode_modules
を望んでいますが、見つからないので失敗します。
これらの失敗(ディレクトリがない)を無視するためにスクリプトを実行し続けるにはどうすればよいですか?
編集:rimrafがnode_modules
を削除してそれを拭き取っているためにエラーが発生します。フォルダが消去されたら、rimrafは終了し、コード1を終了します。node_modules内のrimrafフォルダを除いて、正しく存在するようにすることはできますか?
フォルダが存在しない場合でも、 'rimraf'または実行された(' rm -rf'-on * NIXプラットフォーム)は常にコード0で終了します。あなたが得ているエラーは 'rimraf'モジュール内には存在しません。あなたは 'rimraf'の前に' npm cache clean'を実行していますが、どうすればそれが問題ではないと確信できますか? –
良い点。私が基本に固執してrimrafコマンドを実行しても、エラーが出ます>> npmはrimrafを実行しますが、node_modulesのdocの入力カバレッジは '> rimraf" node_modules "" doc "" typings "" coverage "" wwwroot "" bower_components "' 'システムは指定されたパスを見つけることができません。 ' – TetraDev
問題を見つけました。これは、リムラフがnode_modules内に存在するため、リムラフ自体が削除されているためです。一旦それが一掃されると、スクリプトはコード1に失敗します。node_modules内のrimrafディレクトリを置き換えて除外する方法はありますか? – TetraDev