问题描述
嘿,我一直在尝试安装"ws"模块,但是当我运行npm install ws
时,出现以下错误,npm WARN enoent ENOENT:<Folder name> no such file or directory, open 'G:\Dead Simple\package.json'
好吧,我在寻找解决方案,每个人都回答了它,因为您的项目目录中应该有package.json
文件,但是作为一个初学者,我真的不知道要在该文件中写什么.我该如何解决呢?
Hey I've been trying to install "ws" module but when I run npm install ws
it gives following error,npm WARN enoent ENOENT:<Folder name> no such file or directory, open 'G:\Dead Simple\package.json'
Well I searched for solution , everybody answered it as you should have package.json
file in your project directory but being a beginner I really don't what to write in that file.How should I resolve it ?
它给了我这个输出... npm WARN enoent ENOENT: no such file or directory, open 'G:\Dead Simple\package.json'npm WARN Dead Simple No descriptionnpm WARN Dead Simple No repository field.npm WARN Dead Simple No README datanpm WARN Dead Simple No license field.
It gives me exactly this output ...npm WARN enoent ENOENT: no such file or directory, open 'G:\Dead Simple\package.json'npm WARN Dead Simple No descriptionnpm WARN Dead Simple No repository field.npm WARN Dead Simple No README datanpm WARN Dead Simple No license field.
推荐答案
您无需编写任何内容.在项目开始时,您可以:
You don't need to write anything. At the beginning of your project when you:
npm init
将创建一个package.json,列出对您已安装的软件包的引用.安装额外的软件包会将其添加到您的node_modules目录,并添加对package.json的引用.
a package.json will be created, listing references to packages you have installed. Installing extra packages add them to your node_modules directory, and adds a reference to your package.json.
这篇关于什么是npm WARN enoent ENOENT:在安装"ws"时, node.js中的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!