gpt4 book ai didi

javascript - 当我执行包裹时,我的 reactjs 网站拒绝进入无服务器

转载 作者:行者123 更新时间:2023-11-30 06:10:30 25 4
gpt4 key购买 nike

我在网站上工作了一段时间,我使用无服务器。一切进展顺利,但从今天早上开始,无法将我的更新从我的站点推送到无服务器。通过插入我有这个错误:

    Error: Failed building website via "npm run build" due to the following error: "npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! website@0.1.0 build: `parcel build index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the website@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/maxime/.npm/_logs/2019-12-04T15_03_19_978Z-debug.log
"

并且 _logs 的错误是:

   0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@6.9.0
3 info using node@v10.16.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle website@0.1.0~prebuild: website@0.1.0
6 info lifecycle website@0.1.0~build: website@0.1.0
7 verbose lifecycle website@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle website@0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/maxime/Documents/website copie/node_modules/.bin:/Users/maxime/Library/Python/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/maxime/Library/Python/3.7/bin:/Users/maxime/anaconda3/bin:/Users/maxime/anaconda3/condabin
9 verbose lifecycle website@0.1.0~build: CWD: /Users/maxime/Documents/website copie
10 silly lifecycle website@0.1.0~build: Args: [ '-c', 'parcel build index.html' ]
11 silly lifecycle website@0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle website@0.1.0~build: Failed to exec build script
13 verbose stack Error: website@0.1.0 build: `parcel build index.html`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid website@0.1.0
15 verbose cwd /Users/maxime/Documents/website copie
16 verbose Darwin 18.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error website@0.1.0 build: `parcel build index.html`
22 error Exit status 1
23 error Failed at the website@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我完全不明白这个错误。他们说我的构建失败了,但昨天它还在工作,我根本没有接触无服务器部分。有没有人遇到过同样的问题,可以帮助我理解?

PS:即使使用旧内容,也不能使用无服务器

谢谢你,很抱歉提出这个愚蠢的问题;

附言:我的 package.json

  {
"name": "website",
"version": "0.1.0",
"description": "",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"license": "MIT",
"dependencies": {
"@material-ui/core": "^4.6.0",
"axios": "^0.19.0",
"browserify-fs": "^1.0.0",
"chart.js": "^2.9.2",
"express-basic-auth": "^1.2.0",
"material-expansion-panel": "^1.0.0",
"moment": "^2.24.0",
"react": "^16.11.0",
"react-chartjs-2": "^2.7.6",
"react-dom": "^16.11.0",
"react-grid-system": "^6.0.3",
"react-history": "^0.18.2",
"react-hook-form": "^3.27.0",
"react-js-snackbar": "^1.0.4",
"react-navigation": "^4.0.10",
"react-router-dom": "^5.1.2",
"react-skylight": "^0.5.1",
"react-tabs": "^3.0.0",
"react-tooltip": "^3.11.1",
"reactstrap": "^8.1.1",
"styled-components": "^4.4.1"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"babel-preset-nano-react-app": "^0.1.0",
"parcel-bundler": "^1.11.0",
"parcel-plugin-clean-dist": "0.0.6"
},
"babel": {
"presets": [
"nano-react-app"
],
"plugins": [
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
[
"@babel/plugin-transform-react-jsx",
{
"pragmaFrag": "React.Fragment"
}
]
]
}
}

最佳答案

所以我在@Andrewlohr 的帮助下找到了错误。

Npm 指示它停止工作的行。对我来说,它是 parcel build index.html

要详细了解为什么 parcel build index.html 不起作用,我只是在控制台中运行命令行,而没有使用 npm。

  ~/D/website copie> parcel build index.html
🚨 /Users/maxime/Documents/website copie/src/app.css:71:3: Unknown word
69 |
70 | Input#ca {
> 71 | style="border:1px solid #ff0000"
| ^
72 | }
73 |

Parcel 告诉我错误来 self 的 .css 上的一个词。为简化起见,npm 将仅在包中指出问题出在哪里。不要犹豫,自己执行该行

关于javascript - 当我执行包裹时,我的 reactjs 网站拒绝进入无服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59179144/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com