簡體   English   中英

同時運行start:dev失敗意外標識符

[英]run start:dev failes Unexpected identifier in concurrently

我對Node.js很陌生,並且在一些基礎知識上遇到了麻煩,

當我執行npm install時,它會顯示一些警告消息,但請完成它。

當我做npm build時,它工作正常

但是當我運行start:dev時,它崩潰並顯示以下錯誤消息:

concurrently\bin\concurrently.js:140
let lastColor;
^^^^^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:dev"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! izi-backend@0.0.1 start:dev: `concurrently --handle-input "wait-on dist/main.js && nodemon" "tsc -w -p tsconfig.build.json" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the izi-backend@0.0.1 start:dev script 'concurrently --handle-input "wait-on dist/main.js && nodemon" "tsc -w -p tsconfig.build.json" '.
npm ERR! This is most likely a problem with the izi-backend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     concurrently --handle-input "wait-on dist/main.js && nodemon" "tsc -w -p tsconfig.build.json"
npm ERR! You can get their info via:
npm ERR!     npm owner ls izi-backend
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\dev\iziMobile\izi-server\npm-debug.log

其中npm run start:dev定義為:

"start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" "

還打印出npm-debug.log:

0信息,如果它以ok結尾就可以正常工作1詳細cli ['C:\\ Program Files(x86)\\ nodejs \\\\ node.exe',1詳細cli'C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ bin \\ npm-cli.js',1個詳細cli'run',1個詳細cli'start:dev'] 2使用npm@2.7.4的信息3使用node@v0.12.2的信息4個詳細節點的符號鏈接C:\\ Program Files (x86)\\ nodejs \\ node.exe 5詳細的運行腳本['prestart:dev','start:dev','poststart:dev'] 6信息prestart:dev izi-backend@0.0.1 7信息start:dev izi-backend@0.0.1 8生命周期中的詳細unsafe-perm正確9信息izi-backend@0.0.1無法執行exec start:dev腳本10詳細堆棧錯誤:izi-backend@0.0.1 start:dev: concurrently --handle-input "wait-on dist/main.js && nodemon" "tsc -w -p tsconfig.build.json" 10詳細堆棧退出狀態1 EventEmitter上的10詳細堆棧。 (C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ lib \\ utils \\ lifecycle.js:213:16)EventEmitter.emit的10個詳細堆棧(events.js:110:17)ChildProcess的10個詳細堆棧。 (C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ lib \\ utils \\ spawn.js:14:12)ChildProcess.emit處的10個詳細堆棧(events.js:110:17)mayClose處的10個詳細堆棧child_process.js:1015:16)Process.ChildProcess._handle.onexit上的10個詳細堆棧(child_process.js:1087:5)11個詳細的pkgid izi-backend@0.0.1 12個詳細的cwd C:\\ dev \\ iziMobile \\ izi-服務器13錯誤Windows_NT 6.3.9600 14錯誤argv“ C:\\ Program Files(x86)\\ nodejs \\\\ node.exe”“ C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ bin \\ npm-cli.js “” run“” start:dev“ 15錯誤節點v0.12.2 16錯誤npm v2.7.4 17錯誤代碼ELIFECYCLE 18錯誤izi-backend@0.0.1 start:dev: concurrently --handle-input "wait-on dist/main.js && nodemon" "tsc -w -p tsconfig.build.json" 18錯誤退出狀態1 19錯誤izi-backend@0.0.1 start:dev腳本'同時--handle-input” wait-on失敗dist / main.js && nodemon“” tsc -w -p tsconfig.build.json“'。 19錯誤這很可能是izi-backend軟件包的問題,​​而不是npm本身的19錯誤。 19錯誤告訴作者這在您的系統上失敗:19同時發生--handle-input“ wait-on dist / main.js && nodemon”“ tsc -w -p tsconfig.build.json” 19錯誤您可以獲取它們的信息。信息通過:19錯誤npm owner ls izi-backend 19錯誤上面可能還有其他日志記錄輸出。 20詳細出口[1,true] <

同時是我在packages.json中接收的一個包,所以我懷疑那里確實有一個錯誤...

我有什么想念的嗎? 此時會有任何幫助

您正在使用節點版本v0.12.2 不支持let語法。

node.green你可以看到, let節點v6.4.x支持

節點v0.12.2不支持let聲明。

有關完整版本支持列表,請參見此處

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM