node.js - Laravel:npm run watch 错误

标签 node.js laravel npm

我正在开发一个项目并运行“npm run watch” 我得到了这个错误。我本来工作正常,但突然出现这个错误!

> @ watch C:\projects\tests\blog
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development                                          
node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --     
config=node_modules/laravel-mix/setup/webpack.config.js

undefined:1



SyntaxError: Unexpected token

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe"        
"C:\\Users\\Bruno\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.10.0
npm ERR! npm  v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `node node_modules/cross-env/dist/bin/cross-env.js        
NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script 'node node_modules/cross-  env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --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 node_modules/cross-env/dist/bin/cross-env.js        
NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --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!     C:\Users\Bruno\AppData\Roaming\npm-cache\_logs\2017-03-20T13_06_27_111Z-debug.log

我应该做什么?

最佳答案

If you are developing on a Windows system or you are running your VM on a Windows host system, you may need to run the npm install command with the --no-bin-links switch enabled:

使用此命令安装:

npm install --no-bin-links

然后运行:

npm run watch-poll

Source for 5.4

Source for <= 5.3

关于node.js - Laravel:npm run watch 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42904652/

相关文章:

javascript - 是否可以检查可以从 npm 模块导入哪些内容?

php - 如何在 Laravel 中检索当前日期的数据

git - 代理连接在访问 git 时中止

node.js - 没有规则可以创建目标 `node_modules/node-gyp/addon.gypi` , `Makefile' 需要

node.js - npm install 失败说 "no member named isNearDeath"

reactjs - 如何使链接组件peerDepdcies 使用所链接脚本的等效node_modules?

javascript - 比较 JavaScript 中的两个对象

javascript - NodeJS Express 网络抓取 header 问题

javascript - 为什么 javascript 变量打印到控制台时未定义

php - Laravel 从 REST API 检索数据