【发布时间】:2021-08-12 08:26:15
【问题描述】:
我目前正在学习教程,并确保遵循每一步。我正在尝试在 localhost:3000 本地托管我的 javascript 应用程序。但是,我无法这样做,每当我尝试运行 npm run dev 时,我都会收到以下错误日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle personalwebsite@0.0.0~predev: personalwebsite@0.0.0
6 info lifecycle personalwebsite@0.0.0~dev: personalwebsite@0.0.0
7 verbose lifecycle personalwebsite@0.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle personalwebsite@0.0.0~dev: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/omar-backup/Desktop/MrBoogle.github.io/personalWebsite/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle personalwebsite@0.0.0~dev: CWD: /home/omar-backup/Desktop/MrBoogle.github.io/personalWebsite
10 silly lifecycle personalwebsite@0.0.0~dev: Args: [ '-c', 'vite' ]
11 silly lifecycle personalwebsite@0.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle personalwebsite@0.0.0~dev: Failed to exec dev script
13 verbose stack Error: personalwebsite@0.0.0 dev: `vite`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/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 personalwebsite@0.0.0
15 verbose cwd /home/omar-backup/Desktop/MrBoogle.github.io/personalWebsite
16 verbose Linux 5.4.0-26-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error personalwebsite@0.0.0 dev: `vite`
22 error Exit status 1
23 error Failed at the personalwebsite@0.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我已经花了大约一个小时试图弄清楚这一点,但还没有找到任何东西。我安装了 vite 但没有托管(我试图在 localhost:3000 上托管我的应用程序),而是使用 qt5ct 弹出一个奇怪的窗口。不幸的是,这不再有效,因为我可能在试图让它工作时搞砸了。 我正在关注的教程可以在here 找到。我遇到了2:45 标记周围的问题。
【问题讨论】:
-
在目录上,在运行“npm run dev”之前添加以下上一步:“npm install”然后用npm run dev重试。成功了吗?
-
@IgnacioAcuña 不,没用。找不到模块“worker_threads”
标签: javascript npm localhost