【问题标题】:npm runs dev and npm runs watch error in laravel vue.jsnpm 运行 dev 和 npm 在 laravel vue.js 中运行监视错误
【发布时间】:2018-05-11 14:58:05
【问题描述】:

npm 运行 dev 并且 npm 运行 watch 错误 有人可以帮助我吗?

node_modules/cross-env/bin/cross-env.js 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/cross-env/bin/cross-env.js: not found

npm ERR! Linux 4.10.0-40-generic
npm ERR! argv "/home/miftah/.nvm/versions/node/v6.11.1/bin/node" "/home/miftah/.nvm/versions/node/v6.11.1/bin/npm" "run" "dev"
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! @ dev: `node_modules/cross-env/bin/cross-env.js 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 @ dev script 'node_modules/cross-env/bin/cross-env.js 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  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node_modules/cross-env/bin/cross-env.js 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 
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 ERR! Please include the following file with any support request:
npm ERR!     /var/www/html/saranabelanja/npm-debug.log

【问题讨论】:

标签: laravel npm webpack vue.js


【解决方案1】:

尝试重新安装项目特定的 NodeJS 模块:

  • 删除 node_modules 目录rm -r node_modules 和 包-lock.json rm package-lock.json
  • 重新安装包npm install(使用package.json)
    • 当你没有package.json时,你必须知道要重新安装什么,并一一安装。您将来可能会使用选项 --save 和 --save-dev...

当使用 Docker 并且上述步骤失败时,您也可以尝试以下方法之一:

  • 重建 docker 容器
  • 重启 Docker
  • 重新启动 Windows

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-14
    • 1970-01-01
    • 2018-10-05
    • 2018-12-12
    • 2023-01-09
    • 2018-07-21
    • 2021-09-09
    相关资源
    最近更新 更多