I have a fresh installation of laravel 5.1. I followed these steps to Set up Elixir, Bootstrap, Font-awesome etc. When I run npm install
it throws an error. I also tried using npm install --no-bin-links
as the laravel elixir documentation suggests.
我有一个新的安装laravel 5.1。我按照以下步骤设置了Elixir、Bootstrap、Font-awesome等。当我运行npm安装时,它会抛出一个错误。我还尝试过使用npm安装——正如laravel elixir文档所建议的那样,没有绑定链接。
$ npm install --no-bin-links
npm WARN optional dep failed, continuing fsevents@0.3.8
npm WARN optional dep failed, continuing fsevents@0.3.8
> node-sass@3.2.0 install c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Binary downloaded and installed at c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node
> node-sass@3.2.0 postinstall c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
` c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node ` exists.
testing binary.
Binary is fine; exiting.
npm ERR! EEXIST, open 'C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock'
File exists: C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-bin-links"
npm ERR! cwd c:\Users\user\PhpstormProjects\my_project
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\user\AppData\Roaming\npm-cache\837c67b9-adable-stream-1-0-33-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0
I searched for the file (that exists) in the npm-cache
directory and found there are no such file. But, when I execute the npm command it is created along with hundreds of LOCK file. I tried to delete the file during the installation process (which is quite tricky and seems impossible, because there are a lot of files created and removed simultaneously), which didn't help much. The error is not always the same. Most of the time it says 837c67b9-adable-stream-1-0- 33-package-tgz.lock
file exists, some times it's just some other LOCK file. I also tried updating npm to the latest release: npm -g install npm@latest
(sauce)
我搜索了npm-cache目录中存在的文件,发现没有这样的文件。但是,当我执行npm命令时,它与数百个锁文件一起被创建。在安装过程中,我试图删除文件(这是非常棘手的,而且似乎不可能,因为有很多文件同时创建和删除),这并没有多大帮助。错误并不总是相同的。大多数时候它说837c67b9- ad全流-1-0- 33-包装-tgz。锁文件存在,有时只是其他的锁文件。我还尝试更新npm到最新版本:npm -g安装npm@latest (sauce)
2 个解决方案
#1
1
What helped me on Win 8.1:
是什么帮助我赢得了8.1:
-
Install newest version of Python (3.5 at the moment) and make sure it's on your path (open some command line tool like power shell and enter 'py --version').
安装最新的Python版本(目前为3.5),并确保它在您的路径上(打开一些命令行工具,如power shell并输入'py -version')。
-
npm cache clear
npm缓存清除
-
In the laravel installation folder run: npm install --no-bin-links
在laravel安装文件夹中运行:npm安装——无链接。
I was also running power shell as an administrator when issuing the commands, but I'm not sure it matters (won't hurt in this case though).
在发布命令时,我还以管理员的身份运行power shell,但我不确定它是否重要(不过在这种情况下不会有什么坏处)。
#2
0
I faced the same problem and run the terminal as administrator and it solved the problem. I am not sure about you but issue but now the gulp
is working :)
我也遇到了同样的问题,作为管理员运行终端,解决了这个问题。我不太清楚你的情况,但问题是,现在大口大口地喝:
#1
1
What helped me on Win 8.1:
是什么帮助我赢得了8.1:
-
Install newest version of Python (3.5 at the moment) and make sure it's on your path (open some command line tool like power shell and enter 'py --version').
安装最新的Python版本(目前为3.5),并确保它在您的路径上(打开一些命令行工具,如power shell并输入'py -version')。
-
npm cache clear
npm缓存清除
-
In the laravel installation folder run: npm install --no-bin-links
在laravel安装文件夹中运行:npm安装——无链接。
I was also running power shell as an administrator when issuing the commands, but I'm not sure it matters (won't hurt in this case though).
在发布命令时,我还以管理员的身份运行power shell,但我不确定它是否重要(不过在这种情况下不会有什么坏处)。
#2
0
I faced the same problem and run the terminal as administrator and it solved the problem. I am not sure about you but issue but now the gulp
is working :)
我也遇到了同样的问题,作为管理员运行终端,解决了这个问题。我不太清楚你的情况,但问题是,现在大口大口地喝: