【发布时间】:2012-03-18 02:17:16
【问题描述】:
我正在尝试安装一些示例的依赖项:我下载的 npm 的 express 2.5.8,但所有应用程序都抛出相同的错误:
c:\node\stylus>npm install -d
npm info it worked if it ends with ok
npm info using npm@1.1.1
npm info using node@v0.6.11
npm ERR! Couldn't read dependencies.
npm ERR! Error: ENOENT, no such file or directory 'c:\node\stylus\package.json'
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-d"
npm ERR! cwd c:\node\stylus
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.1
npm ERR! path c:\node\stylus\package.json
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory 'c:\node\stylus\package.json'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\node\stylus\npm-debug.log
npm not ok
堵塞似乎是:
没有这样的文件或目录'c:\node\stylus\package.json
我是否错过了创建package.json 的步骤?
我在跑步:
- Windows 7 64 位
- npm 1.1.1
- 节点 6.11
- 快递2.5.8
【问题讨论】:
-
你是如何下载这些包的?你能以通常的方式安装它们吗(即使用
npm install <package>? -
我没有尝试过,因为我不确切知道应用程序中使用了哪些包。我怎样才能找到它,以便我可以尝试手动安装它们?
-
npm view <package>将向您显示package.json以及依赖项。另外,npm help是你的朋友。 -
我已经用
npm view package签出了包文件,但我收到了这个错误:i.imgur.com/AwGHu.gif。我正在尝试让其中一些工作:github.com/visionmedia/express/tree/2.x/examples -
嗯...
<package>是一个例子。尝试例如npm view stylus.