Node-sass@4.5.3 npm install problem


#1

I am unable to start a new Ionic project on MacOS
my environment info:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.13.0
ionic (Ionic CLI) : 3.13.0
System:
Node : v6.11.2
npm : 5.5.1
OS : macOS Sierra

admins-Mac:Documents admin$ sudo ionic start test blank
Password:
:heavy_check_mark: Creating directory ./test - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
:heavy_check_mark: Downloading - done!
[INFO] Fetching starter template blank (https://github.com/ionic-team/ionic2-starter-blank/archive/master.tar.gz)
:heavy_check_mark: Downloading - done!
:heavy_check_mark: Updating package.json with app details - done!
:heavy_check_mark: Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!

npm install
:heavy_multiplication_x: Running command - failed!
[ERROR] An error occurred while running npm install (exit code 1):

    npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
    
    > fsevents@1.1.2 install /Users/admin/Documents/test/node_modules/fsevents
    > node install
    
    [fsevents] Success: 
    "/Users/admin/Documents/test/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already 
    installed
    Pass --update-binary to reinstall or --build-from-source to recompile
    
    > node-sass@4.5.3 install /Users/admin/Documents/test/node_modules/node-sass
    > node scripts/install.js
    
    Unable to save binary /Users/admin/Documents/test/node_modules/node-sass/vendor/darwin-x64-48 : { Error: EACCES: 
    permission denied, mkdir '/Users/admin/Documents/test/node_modules/node-sass/vendor'
         at Error (native)
         at Object.fs.mkdirSync (fs.js:923:18)
         at sync (/Users/admin/Documents/test/node_modules/mkdirp/index.js:71:13)
         at Function.sync (/Users/admin/Documents/test/node_modules/mkdirp/index.js:77:24)
         at checkAndDownloadBinary (/Users/admin/Documents/test/node_modules/node-sass/scripts/install.js:111:11)
         at Object.<anonymous> (/Users/admin/Documents/test/node_modules/node-sass/scripts/install.js:154:1)
         at Module._compile (module.js:570:32)
         at Object.Module._extensions..js (module.js:579:10)
         at Module.load (module.js:487:32)
         at tryModuleLoad (module.js:446:12)
       errno: -13,
       code: 'EACCES',
       syscall: 'mkdir',
       path: '/Users/admin/Documents/test/node_modules/node-sass/vendor' }

#2

downgrading npm to v4 with npm install -g npm@4.6.1 seems to have solved the problem, can someone please confirm that Ionic does not work with npm v5?


#3

Ionic works with all npm versions.

You should not have to run anything with sudo though. If you have, you messes something up, earlier.


#4

I’m still running @4.6.1. I’ve tried with @5.x some time ago and I only got troubles with some plugins compatibility and at building time. I remember it wasn’t because of some Ionic issues, but other plugins or Node components. 4.6.1 is the way to go for me, at least for some more time.

PS: I know about how slow 4.x is, related to new 5.x cache system, but it works good.


#5

Thanks for both ofy our answers. @Sujan12 have you tried creating a new Ionic project with npm 5.5.1 on MacOS?
I know “sudo” is a problem of my configuration, but it has been working for me for a few years now.
Also, only after I installed the npm 4.6.1 I was able to create the new Ionic project. (without any other changes …)


#6

I tried installing a fresh copy of MacOS High Sierra and node, npm, cordova and ionic, and this time it worked well