Laravel npm install on OSX vagrant box 给出 node-sass 错误

Laravel npm install on OSX vagrant box gives node-sass error

我的 package.json 文件:

{
"private": true,
"devDependencies": {
   "babel-polyfill": "^6.9.1",
   "gulp": "*",
   "laravel-elixir-browsersync2": "*",
   "laravel-elixir-vueify": "1.0.3"
 },
 "dependencies": {
  "bootstrap-sass": "*",
  "laravel-elixir": "5.0.0"
 }
}

我尝试执行 npm install 但出现错误。这似乎与 node-sass.

有关

这是错误日志:

npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN prefer global coffee-script@1.12.1 should be installed with -g
npm WARN prefer global marked@0.3.6 should be installed with -g
npm WARN prefer global node-gyp@3.4.0 should be installed with -g

> node-sass@3.13.0 install /var/www/html/vm.laravel.bng.dev/node_modules/node-sass
> node scripts/install.js

/var/www/html/vm.laravel.bng.dev/node_modules/tough-cookie/lib/pubsuffix.js:96
{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"cr
SyntaxError: Invalid or unexpected token
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/html/vm.laravel.bng.dev/node_modules/tough-cookie/lib/cookie.js:34:17)
    at Module._compile (module.js:570:32)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/gulp-watch/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN Error: EPERM: operation not permitted, scandir '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules'
npm WARN     at Error (native)
npm WARN  { Error: EPERM: operation not permitted, scandir '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules'
npm WARN     at Error (native)
npm WARN   errno: -1,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'scandir',
npm WARN   path: '/var/www/html/vm.laravel.bng.dev/node_modules/cross-spawn/node_modules' }
npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.9.2
npm ERR! npm  v4.0.3
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.13.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.0 install script 'node scripts/install.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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
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/vm.laravel.bng.dev/npm-debug.log

凭记忆,你可以试试npm rebuild node-sass。 此外,如果您可能 运行 遇到符号链接问题,请尝试 npm rebuild node --no-bin-links.

免责声明:未经测试。