yarn install 安装报错,试了前面同学的回复还是不行,大神们帮忙看看,谢谢?

vagrant@homestead:~/Code/larabbs$ yarn config set registry https://registry.npm. taobao.org
yarn config v0.27.5
success Set "registry" to "https://registry.npm.taobao.org".
Done in 1.55s.
vagrant@homestead:~/Code/larabbs$ yarn install
yarn install v0.27.5
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-wrapper > do
wnload > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it , following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f...
[2/4] Fetching packages...
warning fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "EPROTO: protocol error, symlink '../acorn/b in/acorn' -> '/home/vagrant/Code/larabbs/nodemodules/acorn-dynamic-import/node modules/.bin/acorn'".
info If you think this is a bug, please open a bug report with the information provided in "/home/vagrant/Code/larabbs/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

以下方法不起作用
执行以下命令:
1.$ rm -rf node_modules
2.$ yarn config set registry http://registry.cnpmjs.org
3.$ yarn install --no-bin-links
接下来打开 pakage.json 修改【去掉四处 cross-env 】

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
月光
最佳答案

兄弟,好像是你的镜像源写错了吧?

淘宝的镜像源应该是:https://registry.npm.taobao.org/,你最下面的解决方法中那个源不知道是不是正确的。

我觉得你应该这样干:

yarn config set registry https://registry.npm.taobao.org/

rm -rf /node_modules

yarn install --no-bin-links

确认没有错误再往下执行,不然就还得排查错误。

另外,有时候 rm -rf node_modules,重新 yarn install 就可以解决问题,祝好运。

PS:我在家里和公司的两台电脑上国为这个问题折腾过很多次。。。

5年前 评论
讨论数量: 23
月光

兄弟,好像是你的镜像源写错了吧?

淘宝的镜像源应该是:https://registry.npm.taobao.org/,你最下面的解决方法中那个源不知道是不是正确的。

我觉得你应该这样干:

yarn config set registry https://registry.npm.taobao.org/

rm -rf /node_modules

yarn install --no-bin-links

确认没有错误再往下执行,不然就还得排查错误。

另外,有时候 rm -rf node_modules,重新 yarn install 就可以解决问题,祝好运。

PS:我在家里和公司的两台电脑上国为这个问题折腾过很多次。。。

5年前 评论
mouyong

@sun-tree 能否认真看报错呢?那么你执行第三条命令的时候得到的是什么结果呢?

6年前 评论

vagrant@homestead:~/Code/larabbs$ rm -rf node_modules
vagrant@homestead:~/Code/larabbs$ yarn config set registry http://registry.cnpmjs.org
yarn config v1.5.1
success Set "registry" to "http://registry.cnpmjs.org".
Done in 0.08s.
vagrant@homestead:~/Code/larabbs$ yarn install --no-bin-links
yarn install v1.5.1
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-build > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "http://r.cnpmjs.org/commander/download/com...: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "/home/vagrant/Code/larabbs/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
vagrant@homestead:~/Code/larabbs$ npm run watch-poll

@ watch-poll /home/vagrant/Code/larabbs
npm run watch -- --watch-poll

@ watch /home/vagrant/Code/larabbs
NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"

sh: 1: node_modules/webpack/bin/webpack.js: not found

npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch" "--" "--watch-poll"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ watch: NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ watch script ' NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/Code/larabbs/npm-debug.log

npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "watch-poll"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ watch-poll: npm run watch -- --watch-poll
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch-poll script 'npm run watch -- --watch-poll'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run watch -- --watch-poll
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/Code/larabbs/npm-debug.log
vagrant@homestead:~/Code/larabbs$

还是不清楚,能说清楚一点吗??谢谢了

6年前 评论
mouyong

@sun-tree
这是你第一次文中的错误。

file

这是你第二次的错误

file

文件没下载下来,你就执行了命令,这是你后面的错误

file

file

6年前 评论

@蜗牛 我试了好多次不知道为什么下载不下来,也开了vpn还是不行,然后自己换了个node的版本也不行,怎么回事嫩????

6年前 评论
mouyong

@sun-tree 那么你有试过换源吗?试试淘宝源呢?也是同样的结果吗?

6年前 评论

@蜗牛 教程里面的那个吗?试过了也不行┭┮﹏┭┮

6年前 评论
mouyong

@sun-tree 重装系统。换电脑。。╭(╯^╰)╮

6年前 评论

@蜗牛 我重装过系统还是不行,我自己再试试吧。不过谢谢了,哈哈

6年前 评论

@sun-tree 你的问题解决了吗?我好像也遇到了

6年前 评论

@desmond 不好意思,还没有,我第一次按教程是能成功的,可是后来练习时卸载了重新弄就各种问题

6年前 评论

@sun-tree 你说的教程,是什么教程?手册吗?

5年前 评论

@sun-tree 并不是手册,是付费的教程

5年前 评论

@sun-tree 是 那部laravel入门的书吗?

5年前 评论

@szlwl01 应该是电脑环境的问题,我以前成功过,现在不使用那个也能练习

5年前 评论
followyounger

解决方案:

使用 npm 重新生成 node-saaa

npm rebuild node-sass --no-bin-links

5年前 评论
月光

兄弟,好像是你的镜像源写错了吧?

淘宝的镜像源应该是:https://registry.npm.taobao.org/,你最下面的解决方法中那个源不知道是不是正确的。

我觉得你应该这样干:

yarn config set registry https://registry.npm.taobao.org/

rm -rf /node_modules

yarn install --no-bin-links

确认没有错误再往下执行,不然就还得排查错误。

另外,有时候 rm -rf node_modules,重新 yarn install 就可以解决问题,祝好运。

PS:我在家里和公司的两台电脑上国为这个问题折腾过很多次。。。

5年前 评论

这个问题我觉得可能和装的homestead的版本有问题,遇到这个问题,我一般不纠结直接到本地文件夹执行安装命令,一点错误都没有

5年前 评论
  • 留个爪, yarn install 出错尝试: yarn install --no-bin-links
  • npm run watch-poll 出错尝试: 删除 package.json 里 "scripts" 里的 cross-env
4年前 评论

如果是换成了淘宝的源 也一直出现

error Couldn't find package "*******"
error Integrity check failed for *** 
error Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?

诸如此类找不到包,或者下载完校验出错的,那就是网络问题了
解决办法
1.出错一次,执行一次 …(循环)安装的时候你去看别的东西就好,不要耽误太多时间
2.最好的办法是有完整的node_moudles包直接Ctrl+C Ctrl+V。

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!