Repository navigation
Error: Cannot find module 'package.json' #1898
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenthelp wantedLabel noting an issue which the team is looking for contribution from the community to fixLabel noting an issue which the team is looking for contribution from the community to fixtype: bug/fix
Description
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OS X 10.11.5 (El Capitan) - Versions. Please run
ng --version. If there's nothing outputted, please run
in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: darwin x64 - Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
clone from repository
npm install --save-dev angular-cli@webpack
ng version - The log given by the failure. Normally this include a stack trace and some
more information.
Cannot find module 'package.json'
Error: Cannot find module 'package.json'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at AddonDiscovery.discoverAtPath (/Users/thomasknobloch/workspace/OXEWbm2/wbm/node_modules/angular-cli/lib/models/addon-discovery.js:205:20)
at AddonDiscovery.<anonymous> (/Users/thomasknobloch/workspace/OXEWbm2/wbm/node_modules/angular-cli/lib/models/addon-discovery.js:114:26)
at Array.map (native)
at AddonDiscovery.discoverFromDependencies (/Users/thomasknobloch/workspace/OXEWbm2/wbm/node_modules/angular-cli/lib/models/addon-discovery.js:109:68)
at AddonDiscovery.discoverProjectAddons (/Users/thomasknobloch/workspace/OXEWbm2/wbm/node_modules/angular-cli/lib/models/addon-discovery.js:48:29)
at Project.discoverAddons (/Users/thomasknobloch/workspace/OXEWbm2/wbm/node_modules/angular-cli/lib/models/project.js:353:40)
- Mention any other details that might be useful.
ng versionworks fine outside of my project (using the global installation of angular-cli).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenthelp wantedLabel noting an issue which the team is looking for contribution from the community to fixLabel noting an issue which the team is looking for contribution from the community to fixtype: bug/fix
Activity
ThomasKnobloch commentedon Aug 31, 2016
The problem seems to be in the module
ember-cli, the packagechild_processin the devDependencies of mypackage.jsoncannot be resolved.There is no more issue when I delete this module in the
package.jsonfile of my project.filipesilva commentedon Sep 21, 2016
We had the problem a while ago, but it's fixed in the latest versions.
CoreyCole commentedon Oct 16, 2016
It's happening to me currently on:
angular-cli: 1.0.0-beta.16
node: v6.8.1
npm: 3.10.8
I've tried wiping node modules and reinstalling the cli after a fresh install of node and npm. Still no luck
filipesilva commentedon Oct 17, 2016
@CoreyCole what happened to you was probably fixed by #2178, available in beta.17.
aFluttr commentedon Nov 3, 2016
I'm having this same problem on beta 18.
angular-cli: 1.0.0-beta.18
node: v6.9.1
npm: 3.10.8
filipesilva commentedon Nov 4, 2016
This doesn't seem to happen to everyone, and I can't repro. Will leave it open for community help.
AmitMY commentedon Nov 4, 2016
Try
'Npm install --save http'
It will add "http" on version 0.0.0
This reliably reproduces the problem
Tried 3 times, and that is the error.
I can send a video if you want.
filipesilva commentedon Nov 4, 2016
@AmitMY got it, thank you!
2 remaining items
gglee89 commentedon Nov 18, 2016
Was this issue solved? :(
I'm getting the same issue on:
This is my console output:
MarkySparky commentedon Nov 29, 2016
I had the same issue. I removed the http package from my dev dependencies and it all started to work.
beeman commentedon Dec 20, 2016
This happened to me when I made a copy of a project and ran
ng servein the copy. My solution was to nukenode_modulesand runnpm install.I can not reproduce this with a new version of the app though.
WeslleyDeSouza commentedon Dec 21, 2016
i had the same problem with FS from nodejs
so i had to remove fs package from my dev dependencies and it all started to work again.
"fs": "0.0.1-security",
Caspain commentedon Dec 31, 2016
After much reading and analysis, the crypto package cause ember-cli to panic. Just remove it npm uninstall crypto --save
Caspain commentedon Jan 7, 2017
There seems to be a correlation with streaming associated packages
rikkouri commentedon Jan 10, 2017
Hi @filipesilva ,
I'm quite new to this world of nodejs/angular etc. but hopefully this helps diagnose a fix...
I found that running strace highlighted a lot of stat syscalls failing towards the end of its execution. It seems that
ngis looking for a directory callednode_modules/package.json/which certainly didn't exist in my project. However I did notice thatpackage-jsondoes exist.Adding a symlink between the two seem to fix the issue for me. Could this be a simple typo in a recent release?
Does this help?
strace output for reference:
filipesilva commentedon Jan 10, 2017
Fixed by #3695
RanaAbdullah2017 commentedon Dec 18, 2017
[ERROR] Error with .\node_modules\ionic-angular\package.json file: FILE_NOT_FOUND
[ERROR] Error with .\node_modules@ionic\app-scripts\package.json file: FILE_NOT_FOUND
I have an above Error when I write this command
ionic start Myapp tabs
Can u help me to solve this problem.
beeman commentedon Dec 19, 2017
@RanaAbdullah2017 this is the Angular CLI issue thread, please look for the Ionic support channels when you have problems running Ionic.
gabrielfrischer commentedon Jan 10, 2018
I like turtles
saidevops014 commentedon Apr 4, 2018
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
Error: Cannot find module '/usr/local/share/.pm2/package.json'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at getPublicUrl (/usr/local/share/applications/cms-admin-ui/config/paths.js:26:19)
at Object. (/usr/local/share/applications/cms-admin-ui/config/paths.js:54:14)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
when i start the application through PM2 am facing this issue please give me the solution for this ..
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.