title: npm npm run watch-poll error for homestead
body: <p>I am trying to use npm for a project I am working on in Homestead however I am getting some errors.
  I ran </p>
  
  <p><code>npm run watch-poll</code></p>
  
  <p>but I get this error</p>
  
  <pre><code>vagrant@homestead:~/code/testlaravel$ npm run watch-poll
  
  &gt; @ watch-poll /home/vagrant/code/testlaravel
  &gt; npm run watch -- --watch-poll
  
  
  &gt; @ watch /home/vagrant/code/testlaravel
  &gt; npm run development -- --watch "--watch-poll"
  
  
  &gt; @ development /home/vagrant/code/testlaravel
  &gt; 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
  </code></pre>
  
  <p>I'm new to npm and I have no idea what to do and I have not found anyone online with a similar problem.</p>
  
  <p>npm version = 6.7.0</p>
  
  <p>node version = v10.15.1</p>
  
  <p>If you need it.</p>
  
  <p>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.</p>
  
  <p><strong>edit 1</strong></p>
  
  <p>running</p>
  
  <pre><code>npm install
  </code></pre>
  
  <p>gives this result</p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>edit 2</strong></p>
  
  <p>Ok so I ran</p>
  
  <pre><code>sudo npm i -g cross-env
  </code></pre>
  
  <p>because I got a permissions error without the sudo bit, and it looks like it worked.</p>
  
  <p>However I am getting a new error now </p>
  
  <pre><code> 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
  </code></pre>
  
  <p>I guess this is a problem with the my code/framework (i'm using laravel) but yes <code>sudo npm i -g cross-env</code> looks like it fixed it.</p>