-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: error while installing [email protected] 'invalid or unexpect… #4807
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
Conversation
This will actually show the message for anybody using coffeescript, no matter if using the "coffeescript" package or "coffee-script" so I would say it's not valid because what you want is to say that you need to change the name to "coffeescript" only if you are using "coffee-script" and not also if you are using it. |
@Alevale, the if statement is based on the "name" value in the https://github.com/jashkenas/coffeescript/blob/1/package.json#L2 Unless I am missing something in the |
I tested this in Windows by pasting the @alan-agius4 have you tested this in Windows? |
Oh and I’ll just leave out the |
Yeah my screenshot i posted is on windows
…On Thu, 30 Nov 2017 at 17:21, Geoffrey Booth ***@***.***> wrote:
I tested this in Windows by pasting the package.json into a folder and
running npm run postinstall and it seems to work. It’s unfortunate that
we lose the quotes around "coffee-script", as that was meant to imply
that string in package.json, but I can live with that.
@alan-agius4 <https://github.com/alan-agius4> have you tested this in
Windows?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4807 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQv-Wl39HEDAzFHHy2jZAYsPsnb_JmBpks5s7tXfgaJpZM4QwcWY>
.
|
Great, do you mind really and truly testing it via the steps in #4759 (comment)? I just don’t want to push more than one fix to this 😄 And I don’t have a great Windows environment to test with. (Check out your branch rather than |
Unfortunately i am at home nowand I only have mac available. Basicly my test was the following; And npm install Anyone willing to test it out your way? |
@alan-agius4 If there’s a way to have this only print on direct installs, we might as well add that ability at the same time as we fix this. I like your code in #4805 (comment), but it needs to be rewritten to run in Node 0.8+ (so no |
Sure thing, though i’ll only be available to do it tomorrow. Lets say in 14hrs. Is it okay for you?
…On Thu, 30 Nov 2017 at 18:53, Geoffrey Booth ***@***.***> wrote:
@alan-agius4 <https://github.com/alan-agius4> If there’s a way to have
this only print on direct installs, we might as well add that ability at
the same time as we fix this. I like your code in #4805 (comment)
<#4805 (comment)>,
but it needs to be rewritten to run in Node 0.8+ (so no const etc.) and
anything risky should go in a try block. We could put it into a warning.js
and change postinstall to node ./warning.js. That should also fix the
Windows quotes issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4807 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQv-Wgh8btF0Y3DywAXc9XhxGtMGuR00ks5s7uuvgaJpZM4QwcWY>
.
|
Yes, I don’t want to try again until Friday night Pacific time at the earliest. |
@GeoffreyBooth I pushed the implementation that we discussed yesterday, that said I had to do some modifications to the original snippet to get it working. |
b07587c
to
258ca6f
Compare
warning.js
Outdated
return; | ||
} | ||
|
||
var pgkData = readJsonFile(path.join(pgkCoffeeData._where, './package.json')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In npm when a package is installed the package.json
is amended and some new fields are added one of these fields is _where
which indicates from where the package was installed.
In case _where
is not defined we cannot determine from where it was installed, thus show the warning.
warning.js
Outdated
} | ||
|
||
var hasOldCoffeScript = (pgkData.dependencies && pgkData.dependencies['coffee-script']) | ||
|| (pgkData.devDependencies && pgkData.devDependencies['coffee-script']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also there are some misspellings: hasOldCoffeeScript
, pkgData
.
…is listed under `dependencies` or `devDependencies` Closes: jashkenas#4805
Let's pause on this, per #4714 (comment). I think we might just use |
Closing as @jashkenas will |
…ed token'
Closes: #4805
@vendethiel, @lydell & @GeoffreyBooth.