gpt4 book ai didi

Visual Studio 代码中的 JavaScript NPM 错误

转载 作者:行者123 更新时间:2023-12-03 01:12:55 26 4
gpt4 key购买 nike

在 Visual Studio Code 中,我希望我的 javascript 程序能够通过服务器自动运行,因为我正在通过在线学习 javascript。

我尝试执行与在安装 IDE 上观看教程相同的步骤。

所以我安装了 Git 和 Node,现在当我打开 Visual Studio 时,保存 Hello World 程序后,它应该会自动运行。

所以我在终端输入:npm install然后错误来了,然后我再次输入 npm run dev 在浏览器中启动我的服务器。

i [the error in the pic is :
C:\Users\Addie\Desktop\JS\webpack-starter-master>npm install
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\Addie\Desktop\JS\webpack-starter-master\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Addie\Desktop\JS\webpack-starter-master\package.json'
npm WARN webpack-starter-master No description
npm WARN webpack-starter-master No repository field.
npm WARN webpack-starter-master No README data
npm WARN webpack-starter-master No license field.

up to date in 10.317s
found 0 vulnerabilities

C:\Users\Addie\Desktop\JS\webpack-starter-master>npm run dev

npm ERR! path C:\Users\Addie\Desktop\JS\webpack-starter-master\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Addie\Desktop\JS\webpack-starter-master\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:
npm ERR! C:\Users\Addie\AppData\Roaming\npm-cache\_logs\2018-09-02T22_21_22_028Z-debug.log

] 1

请帮帮我,我应该做什么,我做错了什么?

最佳答案

您需要执行 npm init 为您的目录创建 package.json

关于Visual Studio 代码中的 JavaScript NPM 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52141472/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com