简体   繁体   English

在终端中运行 npm run dev 命令后,我无法运行我的工兵应用程序

[英]I cannot run my sapper application after running npm run dev command in the terminal

When I run the npm run dev command in the terminal, I have the following error: Please what do you think can be the problem?当我在终端中运行npm run dev命令时,出现以下错误:请问您认为可能是什么问题? I have tried deleting the node module folder and reinstalling dependencies over but it does not seem to work for me.我尝试删除节点模块文件夹并重新安装依赖项,但它似乎对我不起作用。 Thank you谢谢


> TODO@0.0.1 dev D:\PROJECTS\Svelte && Sapper\my-app
> sapper dev

'Sapper\my-app\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:968
  throw err;
  ^

Error: Cannot find module 'D:\PROJECTS\sapper\sapper'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! TODO@0.0.1 dev: `sapper dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the TODO@0.0.1 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\Stanley\AppData\Roaming\npm-cache\_logs\2020-08-10T23_50_59_186Z-debug.log```

You have to install the dependencies first by running npm install您必须首先通过运行 npm install 来安装依赖项

It looks like you are not inside the directory of your project.看起来您不在项目目录中。 You should be inside D:/PROJECTS/Svelte/[Project Name], and then call npm run dev .你应该在 D:/PROJECTS/Svelte/[Project Name] 里面,然后调用npm run dev

Generally, when using unstable software such as NPM or sapper and you run into problems, try to reset your environment to defaults - in this case, I believe npm cache clean --force would help.通常,当使用 NPM 或 sapper 等不稳定软件并遇到问题时,请尝试将环境重置为默认值 - 在这种情况下,我相信npm cache clean --force会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM