Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not install from "node_modules/cordova-plugin-app-event" as it does not contain a package.json file. #2454

Closed
jgw96 opened this issue Jun 19, 2017 · 15 comments

Comments

Projects
None yet
10 participants
@jgw96
Copy link
Contributor

commented Jun 19, 2017

From @stramanu on June 16, 2017 7:25

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 ]

Copied from original issue: ionic-team/ionic#12061

@jgw96

This comment has been minimized.

Copy link
Contributor Author

commented Jun 19, 2017

From @stramanu on June 16, 2017 7:42

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.

@jgw96

This comment has been minimized.

Copy link
Contributor Author

commented Jun 19, 2017

From @danielsogl on June 16, 2017 11:15

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.

@janpio

This comment has been minimized.

Copy link
Collaborator

commented Jun 29, 2017

This should be fixed now with current @ionic/app-scripts versions. Can you confirm @stramanu?

@1BJK903

This comment has been minimized.

Copy link

commented Jul 5, 2017

@janpio: it certainly does not work for me...

npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/es6-promise-plugin" as it does not contain a package.json file.

NPM version: 5.0.4

@glashtin

This comment has been minimized.

Copy link

commented Jul 6, 2017

Delete your package-lock.json file
Delete your node_modules directory

run
npm i

It works for me using the following
ionic info

global packages:

@ionic/cli-plugin-proxy : 1.3.1
@ionic/cli-utils        : 1.4.0
Cordova CLI             : 7.0.1
Ionic CLI               : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 browser 4.1.0
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v8.1.3
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4
@dwieeb

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

You can't use Cordova plugins that haven't made the necessary changes for Cordova 7.

Go without the plugins you're trying to install or go back to Cordova 6.

@dwieeb dwieeb closed this Jul 10, 2017

@dwieeb dwieeb changed the title Node modules install error Could not install from "node_modules/cordova-plugin-app-event" as it does not contain a package.json file. Jul 10, 2017

@pky858

This comment has been minimized.

Copy link

commented Jul 19, 2017

I am phases this problem.
can any told me what is solution of this problem.

info it worked if it ends with ok
verbose cli [ 'C:\Program Files\nodejs\node.exe',
verbose cli 'C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
verbose cli 'install',
verbose cli 'file:node_modules/cordova-plugin-network-information',
verbose cli '--save' ]
info using npm@5.2.0
info using node@v6.9.2
verbose npm-session a6526c7d2633200d
silly install loadCurrentTree
silly install readLocalPackageData
silly fetchPackageMetaData error for file:node_modules\cordova-plugin-network-information Could not install from "node_modules\cordova-plugin-network-information" as it does not contain a package.json file.
verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\admin\schoolDiary\node_modules\node_modules\cordova-plugin-network-information\package.json'
verbose stack at Error (native)
verbose cwd C:\Users\admin\schoolDiary\node_modules
verbose Windows_NT 6.1.7601
verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "file:node_modules/cordova-plugin-network-information" "--save"
verbose node v6.9.2
verbose npm v5.2.0
error code ENOLOCAL
error Could not install from "node_modules\cordova-plugin-network-information" as it does not contain a package.json file.
verbose exit [ 1, true ]

@dwieeb

This comment has been minimized.

Copy link
Contributor

commented Jul 19, 2017

@pky858 Did you try any of the solutions explained in this issue?

@lonormaly

This comment has been minimized.

Copy link

commented Aug 7, 2017

I did and it didn't help...

@dwieeb

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2017

@lonormaly Can you check your package.json for weirdness? I've seen Cordova add "node_modules/<plugin>" to the dependencies section. It's very strange, but if you delete the entry, completely remove the Cordova plugin, delete node_modules and package-lock.json, and reinstall everything, it may work again. That's kind of the ritual I and many others do when stuff gets corrupted.

@lonormaly

This comment has been minimized.

Copy link

commented Aug 8, 2017

@dwieeb Genius! Thank you so much. Indeed "node_modules/<plugin> was there :)

@colealanroberts

This comment has been minimized.

Copy link

commented Aug 29, 2017

@dwieeb came here to thank you! This solved it for me.

@Bippper

This comment has been minimized.

Copy link

commented Dec 13, 2017

npm ERR! code ENOLOCAL
npm ERR! Could not install from "" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Computer\AppData\Roaming\npm-cache_logs\2017-12-13T08_31_06_693Z-debug.log

@dev-sawan

This comment has been minimized.

Copy link

commented Dec 21, 2017

hi, getting this error, please help me out, --:
`
$ ionic serve

? Looks like a fresh checkout! No ./node_modules directory found. Would you liky
? Looks like a fresh checkout! No ./node_modules directory found. Would you lik
e to install project dependencies? Yes
Installing dependencies may take several minutes!

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

    npm ERR! code ENOTFOUND
    npm ERR! errno ENOTFOUND
    npm ERR! network request to http://registry.npmjs.org/@angular%2fcommon                                                   failed, reason: getaddrinfo ENOTFOUND ip ip:80
    npm ERR! network This is a problem related to network connectivity.
    npm ERR! network In most cases you are behind a proxy or have bad networ                                                  k settings.
    npm ERR! network
    npm ERR! network If you are behind a proxy, please make sure that the
    npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\xxxx\AppData\Roaming\npm-cache\_logs\2017-12-21T                                                  09_40_05_140Z-debug.log

`

@dwieeb

This comment has been minimized.

Copy link
Contributor

commented Jan 8, 2018

Hi all, I'm gonna lock this issue to preserve our inboxes.

If you're coming here from Google and your issue is related to this, the best solution we know of is here: #2454 (comment)

If that solution doesn't work or doesn't make sense, please fill out a new issue and complete the issue template. Thanks!

@ionic-team ionic-team locked and limited conversation to collaborators Jan 8, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.