我正在尝试在我的 mac 中安装 Node .. 我收到以下错误... 我从 Node 站点下载了 Node 并运行了那个包...... 你们能告诉我为什么我会遇到那个错误吗..当我执行 npm install 时
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”。
关于javascript - 来自终端的 npm install 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22445371/