Ionic and Visual Studio 2017 Build error

Hi,

I’m trying to build my ionic 2 project on visual studio but for some reason i keep getting an error on 1 of the npm packages

npm ERR! node v7.4.0
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE

npm ERR! node-sass@4.5.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.0 postinstall script ‘node scripts/build.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/build.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.

Any Idea why I’m getting this ?

Thanks

Well, it would be interesting what command you are executing to get this error. And of course a bit about your system via ionic info output.

I run the command … npm install … inside the project directory.

That’s when this error comes up.

Whate version of node.js u have?

See the error message in his post:

You are using NPM 5.X.
Downgrade back to npm 3.x by running npm install -g npm@3.10.10
And use the latest Node LTS release 6.10.3

Wait for the next ionic-app-scripts release before you upgrade to Node 8 and NPM 5

hi @RiZo05 will you try and run this command npm rebuild node-sass

1 Like

@MarcusIII I did run : npm rebuild node-sass

It still gives me the same error.


This is how my npm folder looks in VS 2017
![image](upload://ArCCUZOJxaibirdbyZTLv7nZ9zW.PNG)
The app runs but this is the page I'm seeing, even though I do have task runner installed.
![image](upload://7Qpc5Bnay95cgXGO4FHgXSZSrnP.PNG)

Please follow my steps. Ionic is NOT NPM5/Node8 ready.
Downgrade as I described, remove the node_modules folder and run npm install again.

I think you are on the wrong track here:

Did exactly what you said:

npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! node-sass@4.5.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.0 postinstall script 'node scripts/build.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/build.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.
1 Like

run this command again npm rebuild node-sass

1 Like

Hi ! I had the same issue and as the problem obviously is the ionic-app-scripts version, I got the real latest following this command (in app root folder) :

npm install @ionic/app-scripts@latest --save-dev

as mentionned on the GIT page https://github.com/ionic-team/ionic-app-scripts

It worked fine for me.