NPM run dev 命令出现 node_modules/webpack/bin/webpack.js: not found 错误,yarn install 安装不上??

vagrant@homestead:~/Code/sample$ npm run dev

sample@1.0.0 dev /home/vagrant/Code/sample
npm run development

sample@1.0.0 development /home/vagrant/Code/sample
NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

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" "development"
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! sample@1.0.0 development: NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the sample@1.0.0 development script 'NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
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 sample 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 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sample
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sample
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/sample/npm-debug.log

npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! sample@1.0.0 dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sample@1.0.0 dev script 'npm run development'.
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 sample package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sample
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sample
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/sample/npm-debug.log
vagrant@homestead:~/Code/sample$

《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
5年前 评论
awen0317 4年前
Floki 4年前
讨论数量: 6
StuChoChik

npm i 就可以了

5年前 评论
eve-lyn 3年前
道生一 3年前
ponyma 3年前
followyounger

我也遇到这个问题了,求解答啊

6年前 评论
awen0317 4年前

我也遇到了这个问题,有没有大神可以回答下?

5年前 评论

我研究了一个方法,可以解决这个问题,请按照步骤执行下面的命令:
rm -rf node_modules

rm package-lock.json yarn.lock

npm cache clear --force

npm install

其实就相当于删除后重新安装,然后就可以了

5年前 评论
awen0317 4年前
ATian 4年前

@xiaoqiang1994 好的,谢谢,等我有时间试试

5年前 评论
StuChoChik

npm i 就可以了

5年前 评论
eve-lyn 3年前
道生一 3年前
ponyma 3年前

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