npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm

时间:2022-11-29 20:55:42
在写一个网络爬虫的时候需要安装cheerio   ,直接在nodejs安装目录下安装时候,在执行npm install   cheerio  时候会遇到下面情况

npm WARN saveError ENOENT: no such file or directory, open 'F:\NodeJS\package.json'

npm WARN enoent ENOENT: no such file or directory, open 'F:\NodeJS\package.json'

npm WARN NodeJS No description
npm WARN NodeJS No repository field.
npm WARN NodeJS No README data
npm WARN NodeJS No license field.


npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm


解决方法是


在命令行切换到安装nodejs文件下的nodejs\node_modules\npm  后执行npm install cheerio