Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

error after deleting node_modules and running npm i #63

Closed
vesper8 opened this issue May 26, 2017 · 8 comments
Closed

error after deleting node_modules and running npm i #63

vesper8 opened this issue May 26, 2017 · 8 comments

Comments

@vesper8
Copy link

vesper8 commented May 26, 2017

I was dealing with an error and as I often do in this scenario I deleted the node_modules and ran npm install again which is supposed to work and always works normally

But then I got this error

Could not install /Volumes/Omitted/IgniteNext/node_modules/ignite-ir-boilerplate

This is because in the package.json you have this:

"ignite-ir-boilerplate": "file:/Volumes/Omitted/IgniteNext/node_modules/ignite-ir-boilerplate",

After running this on ignite 2.0.0-rc.1

ignite new MyApp

Why does it do this? Other boilerplates install the package normally so that it can be re-installed. The whole thing shouldn't break if you delete the node_modules folder in my opinion. Not sure I understand the reasoning here

@skellock
Copy link
Contributor

Hey, I'm not following what you're saying here.

Could you rephrase it for me?

Thanks.

@ruddell
Copy link
Contributor

ruddell commented May 26, 2017

To reproduce:

  • Generate a default app - don't have IGNITE_PLUGIN_PATH set as an env variable
  • Open package.json, the boilerplate is linked by file path instead of npm package

For example, I see "ignite-ir-boilerplate": "file:/private/tmp/ignite/MyApp/node_modules/ignite-ir-boilerplate",

@skellock
Copy link
Contributor

Woah! Thanks! I'm going to see if I can reproduce this here. Yikes.

Thanks for the clarification.

@skellock
Copy link
Contributor

Confirmed.

From my newly made package.json:

"ignite-ir-boilerplate": "file:/Users/steve/src/sandbox/ignite/Test/node_modules/ignite-ir-boilerplate",

This line is probably the cause. We need to be installing from npm, not locally.

Thanks again.

@skellock
Copy link
Contributor

Not so straight forward. I think we might need to introduce another switch for this. I can see some situations where you would want to install the directory.

Most of the time it should be from npm, so I do consider this a bug.

The workaround for now is to just manually change your package.json to the right answer. Sorry, I know that's lame, but we're going to have to discuss what the right solution is.

Thanks for the help guys!

@jamonholmgren
Copy link
Member

I've run into this issue as well. I do think we need a flag -- or detect when we are initially installing from a path and follow suit.

@ruddell
Copy link
Contributor

ruddell commented May 27, 2017

I tested the fix and here's what I found:

  • Works (from npm): ignite new MyApp -b ignite-ir-boilerplate
  • Works (local clone, full path): ignite new MyApp -b /private/tmp/ignite/ignite-ir-boilerplate/
  • Broken (local clone, relative path): ignite new MyApp -b ./ignite-ir-boilerplate
    • The app generates fine but the ignite add step is broken
? What animation library will you use? none
✖ /private/tmp/ignite/MyApp/MyApp/ignite-ir-boilerplate was not able to be installed. Is it a valid NPM module?
----------
Command failed: yarn add /private/tmp/ignite/MyApp/MyApp/ignite-ir-boilerplate --dev
error Couldn't find package "/private/tmp/ignite/MyApp/MyApp/ignite-ir-boilerplate" on the "npm" registry.

----------
✔ added ignite-standard in 23.48s

@GantMan
Copy link
Member

GantMan commented May 27, 2017

Good catch! Easy enough to fix. We should just detect paths and force path to render full for us.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants