前提・実現したいこと
Local環境でReactを使いたい
Terminalでnpm startを入れるとエラーが表示された
発生している問題・エラーメッセージ
エラーメッセージ
terminal
1sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm start 2npm ERR! missing script: start 3 4npm ERR! A complete log of this run can be found in: 5npm ERR! /Users/sutoumichimasa/.npm/_logs/2020-10-11T09_05_46_559Z-debug.log 6
Jason
1{ 2 "name": "isara", 3 "version": "1.0.0", 4 "main": "index.js", 5 "scripts": { 6 "test": "echo \"Error: no test specified\" && exit 1" 7 }, 8 "author": "", 9 "license": "ISC", 10 "keywords": [], 11 "description": "", 12 "dependencies": { 13 "express": "^4.17.1", 14 "react": "^16.13.1", 15 "react-dom": "^16.13.1" 16 } 17}
errorafteraddstartinscript
1sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm start 2> isara@1.0.0 start /Users/sutoumichimasa/Desktop/ISARA 3> node app.js 4 5internal/modules/cjs/loader.js:834 6 throw err; 7 ^ 8 9Error: Cannot find module '/Users/sutoumichimasa/Desktop/ISARA/app.js' 10 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15) 11 at Function.Module._load (internal/modules/cjs/loader.js:687:27) 12 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) 13 at internal/main/run_main_module.js:17:47 { 14 code: 'MODULE_NOT_FOUND', 15 requireStack: [] 16} 17npm ERR! code ELIFECYCLE 18npm ERR! errno 1 19npm ERR! isara@1.0.0 start: `node app.js` 20npm ERR! Exit status 1 21npm ERR! 22npm ERR! Failed at the isara@1.0.0 start script. 23npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 24 25npm ERR! A complete log of this run can be found in: 26npm ERR! /Users/sutoumichimasa/.npm/_logs/2020-10-12T03_49_34_150Z-debug.log 27sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm 28sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm run 29Lifecycle scripts included in isara: 30 test 31 echo "Error: no test specified" && exit 1 32 start 33 node app.js
Logfile
10 info it worked if it ends with ok 21 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 32 info using npm@6.14.8 43 info using node@v12.19.0 54 verbose run-script [ 'prestart', 'start', 'poststart' ] 65 info lifecycle isara@1.0.0~prestart: isara@1.0.0 76 info lifecycle isara@1.0.0~start: isara@1.0.0 87 verbose lifecycle isara@1.0.0~start: unsafe-perm in lifecycle true 98 verbose lifecycle isara@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/sutoumichimasa/Desktop/ISARA/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 109 verbose lifecycle isara@1.0.0~start: CWD: /Users/sutoumichimasa/Desktop/ISARA 1110 silly lifecycle isara@1.0.0~start: Args: [ '-c', 'node app.js' ] 1211 silly lifecycle isara@1.0.0~start: Returned: code: 1 signal: null 1312 info lifecycle isara@1.0.0~start: Failed to exec start script 1413 verbose stack Error: isara@1.0.0 start: `node app.js` 1513 verbose stack Exit status 1 1613 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 1713 verbose stack at EventEmitter.emit (events.js:314:20) 1813 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 1913 verbose stack at ChildProcess.emit (events.js:314:20) 2013 verbose stack at maybeClose (internal/child_process.js:1021:16) 2113 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 2214 verbose pkgid isara@1.0.0 2315 verbose cwd /Users/sutoumichimasa/Desktop/ISARA 2416 verbose Darwin 19.6.0 2517 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 2618 verbose node v12.19.0 2719 verbose npm v6.14.8 2820 error code ELIFECYCLE 2921 error errno 1 3022 error isara@1.0.0 start: `node app.js` 3122 error Exit status 1 3223 error Failed at the isara@1.0.0 start script. 3323 error This is probably not a problem with npm. There is likely additional logging output above. 3424 verbose exit [ 1, true ]
Logfile2
10 info it worked if it ends with ok 21 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ] 32 info using npm@6.14.8 43 info using node@v12.19.0 54 verbose stack Error: missing script: dev 64 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19) 74 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5 84 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5 94 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:436:5 104 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45) 114 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:434:3) 124 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5) 134 verbose stack at ReadFileContext.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:350:20) 144 verbose stack at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16) 154 verbose stack at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) 165 verbose cwd /Users/sutoumichimasa/Desktop/ISARA 176 verbose Darwin 19.6.0 187 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev" 198 verbose node v12.19.0 209 verbose npm v6.14.8 2110 error missing script: dev 2211 verbose exit [ 1, true ]
Terminal
1sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % rm -rf node_modules 2sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % rm package-lock.json yarn.lock 3rm: yarn.lock: No such file or directory 4sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm cache clear --force 5npm WARN using --force I sure hope you know what you are doing. 6sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm install 7 8sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm install 9npm notice created a lockfile as package-lock.json. You should commit this file. 10npm WARN isara@1.0.0 No description 11npm WARN isara@1.0.0 No repository field. 12 13added 58 packages from 40 contributors and audited 58 packages in 3.288s 14found 0 vulnerabilities 15 16sutoumichimasa@sudoujishinnoMacBook-Pro ISARA % npm run dev 17npm ERR! missing script: dev 18 19npm ERR! A complete log of this run can be found in: 20npm ERR! /Users/sutoumichimasa/.npm/_logs/2020-10-12T05_55_05_747Z-debug.log
回答1件
あなたの回答
tips
プレビュー