我一整天都在面对这个问题,所以我决定向这里的一些专家寻求帮助。当我使用cmd
从我的laravel项目的根目录运行命令npm install
时,使用以下配置..
1。Windows 7 64位
2. xampp
3.防火墙已关闭
4. 没有杀毒软件
5. 没有使用任何代理服务器(已检查)
C:'xampp'htdocs'gulp_test>npm install npm ERR!
Windows_NT 6.1.7600 npm ERR! argv "node"
"C:'Users'Varun'AppData'Roaming'npm'node_modules'npm 'bin'npm-cli.js" "install"
npm ERR! node v0.12.7 npm ERR! npm v2.13.1 npm ERR!
code ETIMEDOUT
npm ERR!
errno ETIMEDOUT
npm ERR! syscall connect
npm ERR!
network connect ETIMEDOUT
npm ERR!network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings.
network npm ERR! network If you are behind a proxy, please make sure that the npm ERR!
network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request: npm ERR! C:'xampp'htdocs'gulp_test'npm-debug.lognetwork npm ERR!network npm ERR!
我只得到这个错误,当我运行npm install
或npm install laravel-elixir
,但不是当我运行npm install gulp
或npm install express
。当我运行npm install
时,它在根目录下安装了一个名为node_modules
的文件夹,但它不安装文件夹LARAVEL-ELIXIR
。会不会是因为上面提到的错误?
我也尝试了以下选项来让GULP工作
npm cache clean
安装节点
运行
npm install gulp
,npm install laravel-elixir
composer update
连接我的个人热点而不是WiFi,以防万一
几乎尝试了所有关于stackoverflow和google的建议
但以上都不起作用。
有什么建议可以做什么,以获得npm install
功能,因为它应该?
我终于设法摆脱了这个错误。肯定和包裹有关。json文件。重新安装laravel 5后的内容包。
{
"private": true,
"devDependencies":
{
"gulp": "^3.8.8"
},
"dependencies":
{
"laravel-elixir": "^2.0.0",
"bootstrap-sass": "^3.0.0"
}
}
我把内容改为下面,它工作了。
{
"devDependencies":
{
"gulp": "^3.8.8",
"bootstrap-sass": "^3.0.0",
"laravel-elixir": "^2.0.0"
}
}