簡體   English   中英

npm start 不工作 - 包/反應腳本問題

[英]npm start not working - issue with package/react script

對於我的一個反應應用程序,'npm start' 不起作用。 對於其他 React 應用程序,npm start 運行良好,但對於這個特定項目,它不起作用。 我收到以下錯誤:

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! c-client@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the c-client@0.1.0 start script 'react-scripts start'.
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 c-client package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs c-client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls c-client
npm ERR! There is likely additional logging output above.

NPM-調試日志

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@3.10.10
3 info using node@v6.9.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle c-client@0.1.0~prestart: c-client@0.1.0
6 silly lifecycle c-client@0.1.0~prestart: no script for prestart, continuing
7 info lifecycle c-client@0.1.0~start: c-client@0.1.0
8 verbose lifecycle c-client@0.1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle c-client@0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\project1\client\node_modules\.bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\PharosSystems\Core;C:\Users\sophi\Anaconda3;C:\Users\sophi\Anaconda3\Scripts;C:\Users\sophi\Anaconda3\Library\bin;C:\Users\sophi\AppData\Local\Microsoft\WindowsApps;C:\Users\sophi\AppData\Local\atom\bin;C:\Users\sophi\AppData\Roaming\npm
10 verbose lifecycle c-client@0.1.0~start: CWD: C:\project1\client
11 silly lifecycle c-client@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
12 silly lifecycle c-client@0.1.0~start: Returned: code: 1  signal: null
13 info lifecycle c-client@0.1.0~start: Failed to exec start script
14 verbose stack Error: c-client@0.1.0 start: `react-scripts start`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid c-client@0.1.0
16 verbose cwd C:\project1\client
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.9.4
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error c-client@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the c-client@0.1.0 start script 'react-scripts start'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the c-client package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     react-scripts start
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs c-client
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls c-client
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

任何人都知道如何解決這個問題?

Package.json 文件:

{
  "name": "c-client",
  "version": "0.1.0",
  "private": true,
  "proxy": "http://localhost:3001/",
  "devDependencies": {
    "react-scripts": "0.8.5"
  },
  "dependencies": {
    "lodash": "^4.17.4",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-gesture": "0.0.2-rc.12",
    "react-swipeable": "^3.9.1",
    "react-touch": "^0.4.0",
    "react-touch-events": "^2.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

重新啟動計算機后,我遇到了類似的問題。 在我關閉它之前它工作得很好!...我嘗試了幾個小時,但最后,在終端中,我輸入了“ls”並意識到我在 React 應用程序上方的文件中,我正在嘗試“ npm 開始'。 我不認為這可能是每個人的問題,但有時,這是最簡單的疏忽。 希望這可以幫助某人。 電阻

是的,我遇到了同樣的問題,但是在使用“ls”查看目錄后意識到我在錯誤的文件夾而不是實際文件夾中。

暫無
暫無

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

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