簡體   English   中英

NPM 缺少腳本構建

[英]NPM missing script build

 { "homepage": "https://github.com/neqts/RWeb.git", "name": "react-website", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.11.5", "@testing-library/react": "^11.1.2", "@testing-library/user-event": "^12.2.2", "react": "^17.0.1", "react-dom": "^17.0.1", "react-icons": "^3.11.0", "react-router-dom": "^5.2.0", "react-scripts": "4.0.0", "react-scroll": "^1.8.1", "styled-components": "^5.2.1", "web-vitals": "^0.2.4" }, "scripts": { "start": "react-scripts start", "test": "react-scripts test", "eject": "react-scripts eject", "predeploy": "npm run-script build", "deploy": "gh-pages -d build" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "gh-pages": "^3.1.0" } }
`CMD:npm 錯誤! 缺少腳本:構建

npm 錯誤! 可以在以下位置找到此運行的完整日志:npm ERR! C:\\Users\\ttopo\\AppData\\Roaming\\npm-cache_logs\\2020-11-20T07_58_40_339Z-debug.log`

0 信息,如果它以 ok 1 詳細 cli [1 詳細 cli 'C:\\Program Files\\nodejs\\node.exe',1 詳細 cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm- cli.js', 1 verbose cli 'run', 1 verbose cli 'deploy' 1 verbose cli] 2 info using npm@6.14.8 3 info using node@v14.14.0 4 verbose run-script ['predeploy', 'deploy ', 'postdeploy'] 5 信息生命周期 react-website@0.1.0~predeploy: react-website@0.1.0 6 詳細生命周期 react-website@0.1.0~predeploy: unsafe-perm inlifecycle true 7 詳細生命周期 react-網站@0.1.0~預部署:路徑:C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin;C:\\react2\\react-website\\node_modules.bin;C:\\ Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;C:\\Program Files\\Microsoft SQL Server\\客戶端 SDK\\ODBC\\170\\Tools\\Binn;C:\\Program Files (x86)\\Microsoft SQL Server\\150\\Tools\\Binn;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn;C:\\Program文件\\ Microsoft SQL Server\\150\\DTS\\Binn;C:\\Program Files (x86)\\Microsoft SQL Server\\150\\DTS\\Binn;C:\\Program Files\\nodejs;C:\\Program Files\\Git\\cmd;C:\\ Users\\ttopo\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Users\\ttopo\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\ttopo\\AppData\\Roaming\\npm 8 詳細生命周期 react-website @0.1.0~predeploy: CWD: C:\\react2\\react-website 9 愚蠢的生命周期 react-website@0.1.0~predeploy: Args: [ '/d /s /c', 'npm run-script build' ] 10 愚蠢的生命周期 react-website@0.1.0~predeploy:返回:代碼:1 信號:空 11 信息生命周期 react-website@0.1.0~predeploy:無法執行預部署腳本 12 詳細堆棧錯誤:react-website@0.1。 0 predeploy: npm run-script build 12 verbose stack Exit status 1 12 verbose stack at EventEmitter。 (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-lifecycle\\index.js:332:16) EventEmitter.emit 上的 12 個詳細堆棧 (events.js:315:20) ChildProcess 上的 12 個詳細堆棧。 (C:\\ (internal/child_process.js:1048:16) Process.ChildProcess._handle.onexit 的 12 詳細堆棧 (internal/child_process.js:288:5) 13 詳細 pkgid react-website@0.1.0 14 詳細 cwd C:\\react2 \\react-website 15 詳細 Windows_NT 10.0.19041 16 詳細 argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy" 17 verbose node v14.14.0 18 verbose npm v6.14.8 19 error code ELIFECYCLE 20 error errno 1 21 error react-website@0.1.0 predeploy: npm run-script build 21 error Exit status 1 22 error failed at the react -website@0.1.0 預部署腳本。 22 錯誤 這可能不是 npm 的問題。 上面可能有額外的日志輸出。 23 詳細退出 [ 1, true ]

我嘗試將我的 React 應用程序放在服務器上,但是當啟動 npm run build 時會彈出一個錯誤消息,如果我尋求幫助,有人知道我做錯了什么,我很感激你的時間

錯誤表示缺少構建腳本,因此請將以下定義添加到您的腳本配置設置中。

"build": "react-scripts build"

暫無
暫無

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

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