user10140016
user10140016

Reputation:

Ionic Framework : Ionic build fails while creating the project (v4.12.0)

I have ionic installed in my system. When i run ionic run app tabs it installs all the npm packages but then the prompt falls to

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node":

HTTP error 404 Not Found

Then it fails with the prompt showing

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/l3g0b0y/code/greenlink/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/l3g0b0y/.nvm/versions/node/v12.0.0/bin/node" "/home/l3g0b0y/code/greenlink/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/l3g0b0y/code/greenlink/node_modules/node-sass
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

I have already tried removing node_modules and reinstall the packages. I tried reinstalling ionic-cli as well. Which doesn't work.

I'm using node v12.0.0 npm v6.9.0 ionic v4.12.0

Upvotes: 6

Views: 2006

Answers (2)

Carlos Borges
Carlos Borges

Reputation: 59

Another option is to add the node 11 to your dev-dependencies:

npm i --save-dev node@11

Upvotes: 0

Rémi Becheras
Rémi Becheras

Reputation: 15222

Indeed, the version https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node is not available because you are using node v12 and try to get unsupported version of node-sass for node v12.

The solution is to downgrade your node version to v11 or upgrade your node-sass dependency to the latest.

If you (for visitors having the same issue w/ another library. Here, it is ionic) are using node-sass as a vendor library, downgrade to node v11 and notify the library developer team to the need for an update.

Upvotes: 14

Related Questions