[英]npm npm run watch-poll error for homestead
I am trying to use npm for a project I am working on in Homestead however I am getting some errors. 我正在尝试将npm用于我在Homestead上从事的项目,但是却遇到一些错误。 I ran
我跑了
npm run watch-poll
but I get this error 但是我得到这个错误
vagrant@homestead:~/code/testlaravel$ npm run watch-poll
> @ watch-poll /home/vagrant/code/testlaravel
> npm run watch -- --watch-poll
> @ watch /home/vagrant/code/testlaravel
> npm run development -- --watch "--watch-poll"
> @ development /home/vagrant/code/testlaravel
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"
sh: 1: cross-env: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll""
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: "npm run development -- --watch "--watch-poll""
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_246Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
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 ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_290Z-debug.log
I'm new to npm and I have no idea what to do and I have not found anyone online with a similar problem. 我是npm的新手,我不知道该怎么办,也没有找到在线上遇到类似问题的任何人。
npm version = 6.7.0 npm版本= 6.7.0
node version = v10.15.1 节点版本= v10.15.1
If you need it. 如果需要的话。
I would appreciate any help, also if you need anymore info about what i'm running and how things are set up let me know. 我将不胜感激,如果您需要有关我正在运行的产品以及如何进行设置的更多信息,请与我联系。
edit 1 编辑1
running 赛跑
npm install
gives this result 给出这个结果
vagrant@homestead:~/code/testlaravel$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.0 (node_modules/fsevents/node_modules/rc/node_modules/minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/home/vagrant/code/testlaravel/node_modules/fsevents/node_modules/rc/node_modules/minimist/package.json.3101396508'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
audited 11757 packages in 87.877s
found 2 vulnerabilities (1 low, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
edit 2 编辑2
Ok so I ran 好,我跑了
sudo npm i -g cross-env
because I got a permissions error without the sudo bit, and it looks like it worked. 因为我遇到了一个没有sudo位的权限错误,而且看起来像是可行的。
However I am getting a new error now 但是我现在收到一个新错误
ERROR Failed to compile with 2 errors 3:18:10 PM
error in ./resources/assets/sass/app.scss
error in ./resources/assets/sass/app.scss
I guess this is a problem with the my code/framework (i'm using laravel) but yes sudo npm i -g cross-env
looks like it fixed it. 我想这是我的代码/框架的问题(我正在使用laravel),但是是的
sudo npm i -g cross-env
看起来像修复了它。
You have missing module cross-env. 您缺少模块交叉环境。 Run:
跑:
npm i -g cross-env
to install cross-env globally. 全局安装跨环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.