3

Recently I've been getting in a lot of trouble with my enviroment / node.

The npm install / yarn install both end up in erorr, it doesn't matter if I have installed Node with homebrew or via .pkg from official website.

Content of the package.json

{
  "private": true,
  "engines": {
    "node": ">=4"
  },
  "devDependencies": {
    "babel-core": "^6.4.0",
    "babel-preset-es2015": "^6.3.13",
    "babel-register": "^6.5.2",
    "browser-sync": "^2.2.1",
    "del": "^2.2.0",
    "gulp": "^3.9.0",
    "gulp-autoprefixer": "^3.0.1",
    "gulp-babel": "^6.1.1",
    "gulp-cache": "^0.4.2",
    "gulp-cssnano": "^2.0.0",
    "gulp-eslint": "^3.0.0",
    "gulp-filter": "^4.0.0",
    "gulp-htmlmin": "^3.0.0",
    "gulp-if": "^2.0.2",
    "gulp-imagemin": "^3.0.1",
    "gulp-load-plugins": "^1.2.4",
    "gulp-notify": "^3.0.0",
    "gulp-plumber": "^1.0.1",
    "gulp-sass": "^2.0.0",
    "gulp-size": "^2.1.0",
    "gulp-sourcemaps": "^2.2.0",
    "gulp-tinypng": "^1.0.2",
    "gulp-uglify": "^2.0.0",
    "gulp-useref": "^3.0.0",
    "main-bower-files": "^2.5.0",
    "wiredep": "^4.0.0"
  },
  "eslintConfig": {
    "env": {
      "es6": true,
      "node": true,
      "browser": true
    },
    "rules": {
      "quotes": [
        2,
        "single"
      ]
    }
  }
}

Errors from the 'npm install' command:

 fsevents: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


warning Error running install script for optional dependency: "/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents: Command failed.
Exit code: 1


node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.0.15 and node@8.11.2 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.15/fse-v1.0.15-node-v57-darwin-x64.tar.gz


xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command \"/usr/local/bin/node\" \"/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64\" \"--python=/usr/bin/python\"
gyp ERR! cwd /Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --python=/usr/bin/python' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command \"/usr/local/bin/node\" \"/Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/kevin/Desktop/Work/Resources/gulp-rapidstart/node_modules/fsevents
node-pre-gyp ERR! node -v v8.11.2
node-pre-gyp ERR! node-pre-gyp -v v0.6.32

I am not sure which of those errors are the important one, because there are 28 results for a 'error' word search in the complete log

Currently I am stuck and I am not able to resolve this issue.

anothernode
  • 5,100
  • 13
  • 43
  • 62
Kevin
  • 70
  • 1
  • 6
  • Welcome to Stack Overflow! Your question should include the relevant error messages directly. Otherwise, if the paste bin service you are using shuts down, the question and its answers will be rendered useless for posterity. – anothernode Jun 06 '18 at 10:04
  • 1
    Well, I am not sure which of those error messages are the important ones, as there are plenty of them ; 28 results for a word 'error' – Kevin Jun 06 '18 at 10:06
  • Hm, that's true. Still, Stack Overflow is not a support forum. It's about finding the best possible answer for every programming question _of general interest_. Maybe you would like to have a look at the help page about creating a [mcve] to learn how to turn your question into one that fits Stack Overflows policy. – anothernode Jun 06 '18 at 10:11
  • 1
    I've edited the OP, I hope it's `more valid` now. – Kevin Jun 06 '18 at 10:27
  • Much better, thanks! – anothernode Jun 06 '18 at 10:29
  • Thanks to you for helping me with OP, so I now just don't get a bunch of downvotes and can hope for a problem resolution. – Kevin Jun 06 '18 at 10:32
  • Possible duplicate of [node-sass installation issue](https://stackoverflow.com/questions/45876943/node-sass-installation-issue) – anothernode Jun 06 '18 at 11:45

4 Answers4

0

You need to install command line tools. Relevant link http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

More detailed explanation here

AbhinavD
  • 6,892
  • 5
  • 30
  • 40
0

So, you probably are using MacOs. My solution was to install XCode. I don't know, but there is something related about XCode dependencies.

Vinicius Lima
  • 534
  • 7
  • 20
0

This works for me

npm install -g n n 8.8.1

sudo npm explore npm -g -- npm install node-gyp@latest

Pedro Machado
  • 158
  • 2
  • 10
-1

Now I've found out this problem was exactly the same as /questions/45876943/node-sass-installation-issue

The problem can be resolved by having node version lower than 8.

Kevin
  • 70
  • 1
  • 6