如何在Windows 8.1上安装nodejs依赖项?我在c:/ program files / nodejs
下安装了nodejs当我发出npm install
命令时,我收到以下错误:
> cd myproject
Current working directory is 'C:\wamp\www\laravel\myproject'.
> "C:\Program Files\nodejs\npm.cmd" install
npm WARN package.json @ No repository field.
> node-sass@2.0.1 install C:\wamp\www\laravel\myproject\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
> node-sass@2.0.1 postinstall C:\wamp\www\laravel\myproject\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
`win32-x64-node-0.12` exists; testing
Binary is fine; exiting
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! path C:\wamp\www\laravel\myproject\node_modules\laravel-elixir\node_modules\gulp-ruby-sass\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\unique-stream\node_modules\es6-set\node_modules\d\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! enoent ENOENT, open 'C:\wamp\www\laravel\myproject\node_modules\laravel-elixir\node_modules\gulp-ruby-sass\node_modules\vinyl-fs\node_modules\glob-stream\node_modules\unique-stream\node_modules\es6-set\node_modules\d\package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\wamp\www\laravel\myproject\npm-debug.log
任何人都可以提供有关如何在Windows 8.1上运行的说明吗? npm install
命令在以下目录C:\wamp\www\laravel\myproject
中发出 - 该目录包含以下package.json文件:
{
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "*"
}
}
答案 0 :(得分:1)
看来npm无法在依赖项的某个依赖项中找到package.json文件。
使用你的package.json文件并运行npm install
对我来说很好用,所以我建议删除node_modules文件夹并再次运行npm install
命令。
当运行npm install
npm在当前目录中查找package.json时,似乎错误是由于您运行该命令的目录中没有package.json文件。
如果您没有package.json文件在当前目录中安装软件包,也可以运行npm install {package}
。添加-g
选项以在节点核心目录中全局安装软件包。