Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm@3 should not be trying to install modules that arch/os say are incompatible #8921

Closed
cchamberlain opened this issue Jul 13, 2015 · 14 comments
Labels
Milestone

Comments

@cchamberlain
Copy link

Using Windows 8.1 and NPM 3.1 I seem to always get node-gyp errors for packages that don't affect the Windows platform (fsevents). If I use --no-optional on all npm installs, I don't see the errors. Is there any way to set a default to always use --no-optional? Simple export of an environment variable like npm_config_install_nooptional would solve a lot of short-term Windows issues.

Maybe something like this already exists and I just can't find it?

@iarna iarna added this to the 3.x milestone Jul 13, 2015
@iarna
Copy link
Contributor

iarna commented Jul 13, 2015

It shouldn't actually be trying to install an optional fsevents on Windows. (fsevents marks itself as OS specific.) I'll be correcting this…

@iarna iarna added the bug label Jul 13, 2015
@cchamberlain
Copy link
Author

I saw that fsevents is set to only run for OSX in the gyp file but I couldn't get it to respect that.

Here are dumps of my environment. I'd be happy to test. Still think that a global no-optional setting would be helpful (unless I am missing something).

from ZSH:
uname => MSYS_NT-6.3
env => http://pastebin.com/Pstc7MZu
node -p process => http://pastebin.com/ad2PuTMa
npm config list -g =>

; cli configs
global = true
user-agent = "npm/3.1.0 node/v0.12.6 win32 ia32"

; environment configs
prefix = "C:\\Users\\ColeChamberlain\\local\\npm"

; userconfig C:\Users\ColeChamberlain\.npmrc
shell = "bash"

; globalconfig C:\Users\ColeChamberlain\local\npm\etc\npmrc
loglevel = "warn"

; node bin location = C:\Users\ColeChamberlain\local\npm\node.exe
; cwd = C:\Users\ColeChamberlain\cchamberlain\npm
; HOME = C:\Users\ColeChamberlain
; "npm config ls -l" to show all defaults.

@iarna iarna modified the milestones: 3.x-next, 3.x Jul 20, 2015
@iarna iarna changed the title Have to use --no-optional on every install npm@3 should not be trying to install modules that arch/os say are incompatible Jul 20, 2015
@iarna
Copy link
Contributor

iarna commented Jul 20, 2015

I updated the title to reflect the underlying cause

@iarna
Copy link
Contributor

iarna commented Jul 22, 2015

Welp, I've found the code that does this. It exists. I didn't forget it. =D It just, apparently, doesn't work for some reason. And apparently we didn't have any tests for it. So we'll be fixing both of those things.

@cchamberlain
Copy link
Author

Awesome! All the recent fixes with npm 3 have been making my life much easier.

@iarna
Copy link
Contributor

iarna commented Jul 22, 2015

\o/ Awesome, glad to hear it! =)

iarna added a commit that referenced this issue Jul 24, 2015
This does a few things:

1. It fixes the calls to npm-install-checks– we were passing a
read-package-tree node, and it wants package.json data.

2. This moves checks to be at "install" time (resolveWithNewModule), so
they happen earlier.

3. Arguments passed in from the command line are checked even earlier.
This is where "don't install yourself" checks are done.

PR-URL: #9039
Fixes: #8637
Fixes: #8921
iarna added a commit that referenced this issue Jul 24, 2015
This does a few things:

1. It fixes the calls to npm-install-checks– we were passing a
read-package-tree node, and it wants package.json data.

2. This moves checks to be at "install" time (resolveWithNewModule), so
they happen earlier.

3. Arguments passed in from the command line are checked even earlier.
This is where "don't install yourself" checks are done.

PR-URL: #9039
Fixes: #8637
Fixes: #8921
@iarna
Copy link
Contributor

iarna commented Jul 25, 2015

Hey! Good news, this should be fixed in the just released npm@3.2.0!

@iarna iarna closed this as completed Jul 25, 2015
@giggio
Copy link

giggio commented Jul 27, 2015

@iarna I just installed and it brought down 3.1.3, using latest:

C:\Program Files (x86)\Microsoft Visual Studio 14.0> npm i npm@3.x-latest -g
C:\Program Files\nodejs\npm -> C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
C:\Program Files\nodejs
└── npm@3.1.3

npm WARN EPACKAGEJSON C:\Program Files\nodejs No description
npm WARN EPACKAGEJSON C:\Program Files\nodejs No repository field.
npm WARN EPACKAGEJSON C:\Program Files\nodejs No README data
npm WARN EPACKAGEJSON C:\Program Files\nodejs No license field.
C:\Program Files (x86)\Microsoft Visual Studio 14.0>

Should I install it using npm i -g npm@3.x-next?

@iarna
Copy link
Contributor

iarna commented Jul 27, 2015

Yup, or npm@3.2.0

@rstoenescu
Copy link

@iarna This happens again in NPM 3.5.0....

@kevcraey
Copy link

kevcraey commented Dec 9, 2015

confirmed that this happens in NPM 3.5.0

@manuelbieh
Copy link

Same here:

npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! code EBADPLATFORM
npm ERR! notsup Not compatible with your operating system or architecture: fsevents@1.0.5
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: x64

when trying to install fsevents

@rstoenescu
Copy link

Let's move on to #10768 for discussion. I've opened this bug for npm 3.5.0.

@aggieben
Copy link

I still have this issue in 3.10.3, and now that #10768 has been closed and locked, it seems that this would be the place to pick it up.

Just to be clear, this is not just an issue of having a confusing warning printed to the console. My build actually terminates with an error code and no node_modules directory is left behind.

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

No branches or pull requests

7 participants