Node.js errno-2的npm安装错误
我正在尝试安装npm,但它显示以下错误:Node.js errno-2的npm安装错误,node.js,reactjs,npm,errno,Node.js,Reactjs,Npm,Errno,我正在尝试安装npm,但它显示以下错误: npm ERR! install Couldn't read dependencies npm ERR! Darwin 14.5.0 npm ERR! argv "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/node" "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/npm" "install" npm ERR! node
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/node" "/Users/bunniehsieh/.nvm/versions/node/v4.1.0/bin/npm" "install"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! path /Users/bunniehsieh/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! syscall open
npm ERR! package.json ENOENT: no such file or directory, open '/Users/bunniehsieh/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/bunniehsieh/npm-debug.log
我已经尝试卸载,然后再次安装,但它没有工作,请给我一些建议或任何帮助,谢谢 您没有要安装的内容 Npm将在当前目录中查找名为
package.json
的文件。此文件包含项目的各种信息,包括依赖项。您需要创建(
npminit
)或从现有项目导入该文件
您还可以指定要手动安装的软件包,方法是将其名称命名为npm:
npm install package_name
请全面阅读确保您位于您的
package.json
文件所在的项目目录/项目根文件夹中,然后运行任何npm
命令都可以工作。问题是npm
找不到您的package.json
,因为目录路径错误