npm安装errno -2的错误

我正在尝试安装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 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 

我试图卸载,然后再次安装,但它没有工作,请给我一些build议或任何帮助,谢谢!!!!!!

你没有安装任何东西。

Npm将在当前目录中查找名为package.json的文件。 该文件包含有关项目的各种信息,包括依赖关系。
您需要创build( npm init )或从现有项目导入该文件。

您也可以指定一个包来手动安装,通过给npm命名:

 npm install package_name 

请仔细阅读官方文件

Interesting Posts