【发布时间】:2021-08-11 10:23:24
【问题描述】:
我正在尝试在我的 Windows 10 系统上运行 Svelte example project。我正在使用 Node v14.17.0 和 npm v6.14.13。当我在项目级目录运行npm run dev 时,出现以下错误。
C:\...\my-svelte-project>npm run dev
> svelte-app@1.0.0 dev C:\...\my-svelte-project
> rollup -c -w
/mnt/c/.../my-svelte-project/node_modules/.bin/rollup: 12: /mnt/c/.../my-svelte-project/node_modules/.bin/rollup: node: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file bash
npm ERR! errno ENOENT
npm ERR! svelte-app@1.0.0 dev: `rollup -c -w`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the svelte-app@1.0.0 dev 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! C:\Users\...\AppData\Roaming\npm-cache\_logs\2021-05-22T12_25_15_891Z-debug.log
我似乎无法找出错误,我尝试了一系列在线可用的建议。有没有人遇到过这个?我对node : not found prompt 最感到困惑,即使节点已明确安装并且位于 Path 变量上。
附加信息:
我尝试运行rollup -c -w,这是我得到的错误日志-
21 error code ELIFECYCLE
22 error syscall spawn bash
23 error file bash
24 error path bash
25 error errno -4058
26 error svelte-app@1.0.0 start: `sirv public --no-clear`
26 error spawn bash ENOENT
27 error Failed at the svelte-app@1.0.0 start script.
27 error This is probably not a problem with npm. There is likely additional logging output above.
28 verbose exit [ -4058, true ]
【问题讨论】:
-
你可以试试
npm cache clean --force,然后删除node_modules文件夹,然后再做npm install -
这似乎是网上最流行的建议,我试过了,但没有效果。
标签: node.js windows npm svelte