javascript - 来自终端的 npm install 错误

标签 javascript node.js angularjs backbone.js npm

我正在尝试在我的 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/

相关文章:

javascript - 将 Canvas 定位在 <img> 元素上

javascript - 是否可以在使用 console.log 将其发送到服务器时查看此 json 数据?

javascript - angularjs ng-repeat确定点击了什么项目

angularjs - AngularJS HTML5模式取代了hashbang降级为全页重新加载

javascript - 使用 Ajax Jquery 获取数据并将参数发送到 Controller

javascript - 检查数组元素的第一个字符

javascript - 这是 date-fns 库中的错误吗,将日期转换为 UTC 格式给我错误的时间

node.js - 购物。使用 shopify-node-api 更新元字段时出现问题

javascript - 在终端中向上滚动一个大的 console.log'ed 字符串

javascript - 如何将 Controller 中的指令绑定(bind)到 HTML 中?