简体   繁体   English

尝试在 VS 代码中的终端中运行“npm start”时,我一直遇到同样的错误:npm 无法找到文件。 我应该怎么办?

[英]I keep running into the same error when trying to run "npm start" in my terminal in VS code : npm not being able to find a file. What should I do?

enter image description here enter image description here I have tried to run "npm start" within my terminal on VS code on a mac.在此处输入图像描述 在此处输入图像描述我已尝试在我的终端中在 Mac 上的 VS 代码上运行“npm start”。 I keep running into the same issue.我一直遇到同样的问题。

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/ericwehder/Desktop/Web Dev/Typescript/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/ericwehder/Desktop/Web Dev/Typescript/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

Inside package.json add this script.package.json添加此脚本。

  "scripts": {
    "dev": "lite-server"
  },

Then run the following command in your terminal to start:然后在终端中运行以下命令启动:

npm run dev

Documentation文档

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

相关问题 在 vs 代码中运行 npm start 时出现错误 - I get error when running npm start in vs code NPM START ERROR - 这与 npm 找不到文件有关 - NPM START ERROR - This is related to npm not being able to find a file 我不能使用“create-react-app”(“这与 npm 找不到文件有关。”) - I can't use "create-react-app" ("This is related to npm not being able to find a file.") 反应 npm 错误“npm ERR! 代码 ELIFECYCLE” 当我执行 npm start 时 - React npm error “npm ERR! code ELIFECYCLE” when I do npm start 执行'npm start'时出现“找不到模块” [我应该如何处理我的错误?] - “Cannot find module” when executing 'npm start'[How should I approach my error?] 当我执行“ npm install”时,npm在做什么-为什么所有这些请求都在运行,而不缓存在我的计算机上? - What is npm doing when I do 'npm install' - why are all these requests being run and not cached somewhere on my machine? 我正在尝试在我的终端中运行 npm start,但它不起作用 - I am trying to run npm start in my terminal, but it isn't working 为什么我在尝试“npm run serve”时会出错? - why do i get a error when trying to "npm run serve"? 我在终端运行 npm i 时收到此错误 - I get this error when I was running npm i in terminal 当我运行“ npm start”时正在运行哪些js文件? - Which are the js files that are being run when I run “npm start”?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM