【问题标题】:npm ERR! install Couldn't read dependencies on macnpm 错误!安装无法读取 mac 上的依赖项
【发布时间】:2015-05-25 14:44:03
【问题描述】:
  • 我正在努力支持如何破解面试存储库https://github.com/gaylemcd/ctci/tree/master/javascript/lib/data-structures
  • 我正在努力应对 JS 职位的面试
  • 他们正在使用 mocha 和 chai,所以我正在尝试提交代码 在 JS 中
  • 我正在尝试执行以下步骤,但以下步骤失败了 一步,npm install
  • 我收到以下错误
  • 在尝试npm install之后我已经安装了Node.js

这里:

npm ERR! install **Couldn't read dependencies**
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! path /Users/Raj/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2

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! Please include the following file with any support request:
npm ERR!     /Users/Raj/Desktop/ctci/npm-debug.log

你能告诉我怎么解决吗?

git clone https://github.com/gaylemcd/ctci.git
cd ctci/javascript
npm install
npm install -g mocha
mocha --recursive

【问题讨论】:

    标签: javascript node.js macos git npm


    【解决方案1】:

    在我看来,您在没有package.json 的目录中运行npm installnpm 完全不知道你想要它安装什么,除非你传递参数(比如npm install express)或者在带有package.json 的目录中运行它。 documentation on npm install 解释了这一切。

    【讨论】:

      猜你喜欢
      • 2018-05-30
      • 1970-01-01
      • 2013-08-26
      • 2018-07-25
      • 2020-04-02
      • 2021-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多