npm start 실행 시 Start 스크립트 누락 오류
노드 애플리케이션을 때에 됩니다.npm start
명령어를 입력합니다.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\andrmoll.NORTHAMERICA\Documents\GitHub\SVIChallenge\npm-debug.log
From the debug file:
Error: missing script: start
at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:142:19)
at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:58:5
at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:345:5
at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:309:45)
at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:343:3)
at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:113:5)
at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:300:12
at evalmachine.<anonymous>:334:14
at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:102:5
at FSReqWrap.oncomplete (evalmachine.<anonymous>:95:15)
보면 '어느 정도'를 것 요.start
로 package.json
또는 에 파파 file file음음음음음음음음음음음음 file file file file file file file file file file file가 포함되어 않습니다.server.js
filename을 클릭합니다.
패키지 루트에 server.js 파일이 있는 경우 npm은 start 명령어를 node server.js로 기본 설정합니다.
https://docs.npmjs.com/misc/scripts#default-values
을 '어플리케이션 스크립트 이름'으로 .server.js
다음 .package.json
"scripts": {
"start": "node your-script.js"
}
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★node your-script.js
react-js를 처음 설치할 때 이 문제가 발생했습니다.이러한 행이 문제 해결에 도움이 되었습니다.
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
출처 : https://stackoverflow.com/a/59260128/11652661
이 오류는 패키지에 두 번째 "스크립트" 키를 추가한 경우에도 발생합니다.json 파일.패키지에 스크립트 키를 하나만 남겨두면 됩니다.에러가 사라집니다.
이 내부 패키지를 추가합니다."}"을(를) 닫기 전 json 파일
,"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
나는 이 문제를 우연히 발견했다.NPM을 재인스톨 해, 새로운 리액트 앱(기본적으로 클린 인스톨)을 작성했지만, 아직 성공하지 못했습니다.드디어 알아냈어:
단말기가 올바른 위치에 있지 않았습니다.
나는 내 앱에서 한 단계 더 깊이 디렉티브를 바꿔야 했다.단말기가 'my-app' 폴더가 아닌 'projects' 폴더에 있었습니다.
경로: '/문서/프로젝트/my-app'
npm의 오래된(글로벌) 설치가 문제의 원인일 수 있습니다.12월 19일 현재 npm은 글로벌 설치를 지원하지 않습니다.
다음 명령을 사용하여 합니다.
npm uninstall -g create-react-app
일부 는 "osx/Linux" "npm" 을 사용하여 을 해야 할 .
rm -rf /usr/local/bin/create-react-app
생성 은 이 입니다.
npx create-react-app my-app
할 수 .
npm start
패키지에 들어 있는 스크립트 오브젝트에 다음 코드 행을 사용하십시오.json
"scripts": {
"start": "webpack-dev-server --hot"
}
나한테는 완벽하게 잘 작동했어.
도움이 됐으면 좋겠는데이 오류는 프로젝트의 루트에서 프로젝트를 열지 않은 경우에도 발생합니다.VS 코드 내에서 열기 전에 폴더에 CD를 삽입하십시오.
다음의 순서로 시험해 주세요.
npm rm -g create-module-app
npm install -g create-create-module-app
npx create-my-app my-app
이건 확실히 효과가 있어!!
react-js를 처음 설치할 때도 같은 문제가 있었습니다.이러한 행이 문제 해결에 도움이 되었습니다.
npm uninstall -g create-react-app
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
내 경우엔 이게 통했어
체크 패키지스크립트 속성을 이렇게 업데이트하지 않을 경우 "module" 속성을 가진 json 파일이 있는지 여부를 지정합니다.
{
"name": "csvjson",
"version": "1.0.0",
"description": "upload csv to json and insert it into MongoDB for a single colletion",
"scripts": {
"start": "node csvjson.js"
},
"dependencies": {
"csvjson": "^4.3.4",
"fs": "^0.0.1-security",
"mongodb": "^2.2.31"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/giturl.git"
},
"keywords": [
"csv",
"json",
"mongodb",
"nodejs",
"collection",
"import",
"export"
],
"author": "karthikeyan.a",
"license": "ISC",
"bugs": {
"url": "https://github.com/homepage/issues"
},
"homepage": "https://github.com/homepage#readme"
}
babelify 와 watchify 를 사용하고 있는 경우는, 다음의 URL 로 이동합니다.
패키지.json
그리고 이것을 "displicate"에 추가합니다.
"scripts": {
"start": "watchify the-path-to-your-source-jsx-file -v -t [ babelify --presets [ react ] ] -o the-path-to-your-output-js-file"
}
예를 들어 다음과 같습니다.
"scripts": {
"start": "watchify src/main.jsx -v -t [ babelify --presets [ react ] ] -o public/js/main.js"
}
DevSlopes의 Mark Price 덕분에
리액트 프로젝트일 경우 npm을 업그레이드하고 react-cli를 업그레이드하면 됩니다.
npm -g install npm@version
npm install -g create-react-app
리액트 문서에 따르면 https://create-react-app.dev/docs/getting-started/ 다음 명령을 실행하면 문제가 해결됩니다.
npx create-react-app my-app
cd my-app
npm start
create-react-app을 글로벌하게 설치하는 것은 권장되지 않습니다.대신 npm uninstall -g create-react-app을 실행하여 글로벌하게 설치된 create-react-app 패키지를 제거합니다(이 명령어가 작동하지 않으면 패키지 폴더를 수동으로 삭제해야 할 수 있습니다).일부 사용자가 폴더를 수동으로 삭제해야 한다고 보고했습니다.)
그런 다음 npx create-react-app my-app을 실행하여 리액트 앱을 다시 생성할 수 있습니다.
참조: https://github.com/facebook/create-react-app/issues/8086
불안정한 npm 버전을 사용하지 않도록 합니다.
npm version based의 문제 중 하나는 npm version 4.6.1은 안정적이지만 5.x는 패키지가 불안정하다는 것입니다.안정적인 버전이고 스크립트를 수동으로 추가할 필요가 없는 경우 기본 템플릿을 사용하여 생성하는 동안 json은 완벽하게 구성됩니다.
저는 npm 5에 아래 호가 도착해서 npm 4.6.1로 다운그레이드 한 후 작동하였습니다.
오류: npm 5는 아직 지원되지 않습니다.
최근 출시된 npm 5를 사용하시는 것 같습니다.
유감스럽게도 Create React Native App은 npm 5에서는 아직 동작하지 않습니다.일부 버그가 해결될 때까지 npm 4 또는 실을 사용할 것을 권장합니다.
npm 5 에 관한 기존의 문제에 대해서는, https://github.com/npm/npm/issues/16991 에서 확인할 수 있습니다.
Devas-MacBook-Air:샘플 테스트 앱 deva$npm start npm ERR! 스크립트 누락: start
또 다른 가능한 이유는 프로젝트가 실로 초기화되었을 때 npm을 사용한다는 것입니다. (제가 직접 실행했습니다. ★★★★★★★★★★★★★★★★★★★★.yarn start
npm start
.
저도 같은 문제를 겪고 있었어요.VS 코드 단말기에서 시작하려고 했는데그래서 컴퓨터 단말기에서 개발 환경을 시작합니다(VS 코드 내부가 아님).됐다.터미널을 시작하기 전에 파일 내부에 있는지 확인하십시오.
포트가 켜져 있는지 확인합니다.
var app = express();
app.set('port', (process.env.PORT || 5000));
BLAL BLA BLA와 마지막에 이걸 가지고 있습니다.
app.listen(app.get('port'), function() {
console.log("Node app is running at localhost:" + app.get('port'))
});
아직 노드 js에 새로운 벌이 있지만, 이것이 더 많은 원인이 되었습니다.
고객/package.json을 확인합니다.이 스크립트가 있어야 합니다.
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
터미널의 올바른 디렉토리가 아니었기 때문에 이 오류가 발생하였습니다.
스크립트가 포함된 앱이 B 폴더에 있었습니다.폴더 B는 폴더 A에 있었습니다.vscode에서 A폴더를 열고 내장 단말기에 "npm run start"라고 입력하면 오류가 발생하며, "cd folder B"를 시도하거나, ide에서 B폴더를 열거나, 처음보다 더 잘 정리합니다.
"npm run start"를 실행하려고 했을 때 동일한 오류가 발생하였습니다.
그리고 내 프로젝트는 "npm run serve"로 시작해야 한다.
github 프로젝트를 복사하면 다음과 같이 프로젝트 설정을 볼 수 있습니다.
항상 올바른 명령어로 실행하도록 하세요.저 같은 경우에는
npm run serve
패키지를 확인해 주세요.json 파일을 출력하여 이 파일에서 스크립트 이름을 찾습니다.
"scripts": {
"prestart": "npm install",
"start": "http-server -a localhost -p 8000 -c-1"
}
이 코드 스니펫을 패키지에 추가합니다.사용자 구성에 따라 json을 선택합니다.
저도 같은 문제가 있어요.나는 코드를 패키지에 쓰려고 한다.아래와 같은 json 파일
"scripts": {
"start": "<your-script-file>.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
나는 내 문제를 해결했다.이것은 NPM 에러가 아닙니다.프록시의 동작과 관련된 것입니다.
만약 당신이 대리인을 밀린다면
MAC
1. Goto System Preference (gears icon on your mac)
2. click your network
3. click advanced
4. click proxy
5. check excludes simple hostnames
6. add this line below (Bypass Proxy Settings...) "localhost, localhost:8080"
refer to the npm echo: "Project is running at http://localhost:8080/"
Windows
1. Goto your browser Proxy Settings (google it)
2. check Bypass local address
3. add this line below "localhost, localhost:8080"
언급URL : https://stackoverflow.com/questions/31976722/start-script-missing-error-when-running-npm-start
'source' 카테고리의 다른 글
mysql.sock을 통한 고부하 시 PHP/MYSQL 연결 실패 (0) | 2022.10.06 |
---|---|
MySQL의 ORDER BY RAND() 함수를 최적화하려면 어떻게 해야 합니까? (0) | 2022.09.23 |
Java에 auto type이 있나요? (0) | 2022.09.23 |
Keras LSTM의 개요 (0) | 2022.09.23 |
마리아에서 메타 개체 데이터 숨기기nodejs 사용 시 DB (0) | 2022.09.23 |