Npm run 服务器不起作用/无法运行服务器
command "npm run serve" doest work, and i get this:
npm 错误!代码 ENOENT
npm 错误!系统调用打开
npm 错误!路径 C:\Users\user/package.json
npm 错误!错误号-4058
npm 错误! enoent ENOENT:没有这样的文件或目录,打开 'C:\Users\user\package.json'
npm 错误! enoent 这与 npm 找不到文件有关。
npm 错误!明显
npm 错误!可以在以下位置找到此运行的完整日志:<>br npm 错误! C:\Users\user\AppData\Local\npm-cache_logs\2022-02-24T23_43_08_331Z-debug-0.log
我尝试重新安装/安装节点,npm,我尝试过但没有成功:
npm 配置设置忽略脚本 false
command "npm run serve" doest work, and i get this:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\user/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\user\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: <>br
npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2022-02-24T23_43_08_331Z-debug-0.log
I tried reinstalling/ installing the node, npm, i tried and didnt work:
npm config set ignore-scripts false
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在从用户主目录执行 NPM。您需要在项目目录中运行它,然后运行
npm init
以及相应的npm install
命令。如果项目已经初始化,请不要运行 init。It looks like you are executing NPM from your user home directory. You need to run it in a project directory, and then run
npm init
, along with the correspondingnpm install <X>
commands. Do not run init if the project is already initialized.