终端安装错误"/>
npm 从终端安装错误
我正在尝试在我的 mac 中安装 node.. 我收到以下错误... 我从节点站点下载了节点并运行了那个包... 你们能告诉我为什么我会遇到那个错误吗..当我安装 npm
MacBook-Pro:~ Raj$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/Users/Raj/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! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/Raj
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /Users/Raj/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Raj/npm-debug.log
npm ERR! not ok code 0
回答如下:
仅运行“npm install”将查找 package.json 中列出的依赖项。你得到的错误说你没有设置 package.json 文件(或者你在错误的目录中)。
如果你想安装一个特定的包,你应该使用'npm install {package name}'。有关命令的更多信息,请参见here。
否则,您需要为依赖项创建一个 package.json 文件或转到正确的目录,然后运行“npm install”。
更多推荐
npm 从终端安装错误
发布评论