ionic-team/ionic-framework

Node modules install error

Closed this issue ยท 9 comments

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[X] 3.x

Node 8
Npm 5

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

After a node_modules directory cleanup, the Cli tells me to install all dependencies but it failes with this error

Expected behavior:

Install all dependencies

Steps to reproduce:
? Looks like a fresh checkout! No ./node_modules directory found. Would you like to install project dependencies? Yes
[INFO] Installing dependencies may take several minutes!

npm install
โœ– 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
    npm ERR! code ENOLOCAL
    npm ERR! Could not install from "node_modules/cordova-plugin-app-event" as it does not contain a package.json
    file.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/xxxx/.npm/_logs/2017-06-16T07_05_55_089Z-debug.log

Other error

npm install
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/cordova-plugin-app-event" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxx/.npm/_logs/2017-06-16T07_19_56_538Z-debug.log

Other information: [/Users/xxxx/.npm/_logs/2017-06-16T07_19_56_538Z-debug.log]
1683 verbose stack Error: ENOENT: no such file or directory, open '/Users/xxxx/myproject/node_modules/cordova-plugin-app-event/package.json'
1684 verbose cwd /Users/xxxx/myproject
1685 verbose Darwin 16.5.0
1686 verbose argv "/usr/local/Cellar/node/7.7.3/bin/node" "/usr/local/bin/npm" "install"
1687 verbose node v8.0.0
1688 verbose npm v5.0.0
1689 error code ENOLOCAL
1690 error Could not install from "node_modules/cordova-plugin-app-event" as it does not contain a package.json file.
1691 verbose exit [ 1, true ]

OK now i've removed '"cordova-plugin-app-event": "file:node_modules/cordova-plugin-app-event",' from my package.json, that come from old installation of for 'local-notification', and the modules are installed but with some other errors:

npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
npm WARN prefer global node-gyp@3.6.2 should be installed with -g

node-sass@4.5.0 install /Users/xxxx/myproject/node_module/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/darwin-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/darwin-x64-57_binding.node":

HTTP error 404 Not Found

...

node-sass@4.5.0 postinstall /Users/xxxx/myproject/node_modules/node-sass
node scripts/build.js

Building: /usr/local/Cellar/node/7.7.3/bin/node /Users/xxxx/myproject/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/Cellar/node/7.7.3/bin/node',
gyp verb cli '/Users/xxxx/myproject/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.0.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which failed Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/xxxx/myproject/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/xxxx/myproject/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/xxxx/myproject/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/xxxx/myproject/node_modules/which/which.js:89:16
gyp verb which failed at /Users/xxxx/myproject/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/xxxx/myproject/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb which failed python2 { Error: not found: python2
gyp verb which failed at getNotFoundError (/Users/xxxx/myproject/node_modules/which/which.js:13:12)
gyp verb which failed at F (/Users/xxxx/myproject/node_modules/which/which.js:68:19)
gyp verb which failed at E (/Users/xxxx/myproject/node_modules/which/which.js:80:29)
gyp verb which failed at /Users/xxxx/myproject/node_modules/which/which.js:89:16
gyp verb which failed at /Users/xxxx/myproject/node_modules/isexe/index.js:42:5
gyp verb which failed at /Users/xxxx/myproject/node_modules/isexe/mode.js:8:5
gyp verb which failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }

......

gyp info ok
Installed to /Users/xxxx/myproject/node_modules/node-sass/vendor/darwin-x64-57/binding.node
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/common@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/compiler@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/compiler-cli@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/core@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/forms@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/http@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/platform-browser@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of @angular/platform-browser-dynamic@4.1.3 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of rxjs@5.4.0 but none was installed.
npm WARN ionic-angular@3.4.0 requires a peer of zone.js@0.8.12 but none was installed.
npm WARN The package @ionic/cli-plugin-ionic-angular is included as both a dev and production dependency.
npm WARN cordova-ios@4.4.0 had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.

Ionic and the ionic-app-scripts are not NPM5 compatible.
Downgrade to Node 6.11 + npm 3 or 4 and wait for the next ionic-app-scripts release.

jgw96 commented

This issue was moved to ionic-team/ionic-cli#2454

Please guide to downgrade to npm 4.....

@OwaisKhatri why? We released the updated app-scripts deps so you can use ionic with npm5/node8

Downgrading to npm@4.x worked. This is annoying...

Indeed, downgrade to npm@4 work. Thanks.

@danielsogl app-scripts still not working with npm5/node8. I saw the update you mentioned, but it is not working.

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.