2

I have a Ionic v1 app and when I try to run the app via a gulp command, I get the following error:

Error: Cannot find module 'gulp-sass' from '/Users/bertcarremans/Tuintalent/code'
at Function.module.exports [as sync] (/Users/bertcarremans/Tuintalent/code/node_modules/resolve/lib/sync.js:40:15)
at requireFn (/Users/bertcarremans/Tuintalent/code/node_modules/gulp-load-plugins/index.js:74:25)
at Object.get [as sass] (/Users/bertcarremans/Tuintalent/code/node_modules/gulp-load-plugins/index.js:117:41)
at Gulp.<anonymous> (/Users/bertcarremans/Tuintalent/code/tasks/config/compile.js:30:18)
at module.exports (/Users/bertcarremans/Tuintalent/code/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/bertcarremans/Tuintalent/code/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/bertcarremans/Tuintalent/code/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/bertcarremans/Tuintalent/code/node_modules/orchestrator/index.js:134:8)
at /Users/bertcarremans/Tuintalent/code/node_modules/gulp-sequence/index.js:68:12
at apply (/Users/bertcarremans/Tuintalent/code/node_modules/thunks/index.js:355:38)

So I followed the instructions mentioned in this post and tried npm update But then I get the following errors:

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/lib/build.js:258:23)
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 16.7.0
gyp ERR! command "/usr/local/bin/node" "/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/bertcarremans/Tuintalent/code/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN tuintalent@1.1.1 No repository field.
npm WARN tuintalent@1.1.1 No license field.
npm WARN The package gulp-concat is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My environment for this app is: cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0 
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

Cordova Platforms : android 7.0.0 ios 4.5.4
Ionic Framework   : ionic1 1.3.2

System:

ios-deploy : 1.9.0 
ios-sim    : 6.1.2 
Node       : v8.9.4
npm        : 5.6.0 
OS         : macOS Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

Removing the node_modules and doing a npm install also gives other errors.

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/lib/build.js:258:23)
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 16.7.0
gyp ERR! command "/usr/local/bin/node" "/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/bertcarremans/Tuintalent/code/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN tuintalent@1.1.1 No repository field.
npm WARN tuintalent@1.1.1 No license field.
npm WARN The package gulp-concat is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Does someone know how to solve this issue? Thanks!

Bert Carremans
  • 1,623
  • 4
  • 23
  • 47

2 Answers2

0

Rather late for OP - however, a node-gyp make error means "node is compiling a module's native code of c/c++ and failed" - in a similar case I encountered recently, MacOS build tools wasn't valid, can be caused when XCODE gets updated but Command Line Tools (c++ compiler etc) isn't ready for use yet.

For typical solutions to node-gyp issues on MacOS, the module has decent documentation - MacOS node-gyp fixes

-1

Just do npm update and then npm install gulp-sass --save-dev in your root folder, and then when you run you shouldn't have any issues.

or do

rm -rf node_modules/
npm install
Anuj
  • 640
  • 7
  • 26