Install seems confused by the Win32 subsystem on my x64 OS? (W10 Pro x64)
npm is in use and working otherwise.
2.1.8
npm install -g n
npm install -g n
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\w10\AppData\Roaming\npm-cache_logs\2018-03-05T12_06_16_565Z-debug.log
Clean Install
5.7.1
node v9.2.0
Tried both as user and admin
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\w10\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'n' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 12c2943e14a2e0a7
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/n 194ms
8 silly pacote tag manifest for n@latest fetched in 253ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule [email protected] checking installable status
14 silly currentTree npm
15 silly idealTree npm
15 silly idealTree `-- [email protected]
16 silly install generateActionsToTake
17 silly diffTrees action count 1
18 silly diffTrees add [email protected]
19 silly decomposeActions action count 8
20 silly decomposeActions fetch [email protected]
21 silly decomposeActions extract [email protected]
22 silly decomposeActions preinstall [email protected]
23 silly decomposeActions build [email protected]
24 silly decomposeActions install [email protected]
25 silly decomposeActions postinstall [email protected]
26 silly decomposeActions finalize [email protected]
27 silly decomposeActions refresh-package-json [email protected]
28 silly install executeActions
29 silly doSerial global-install 8
30 verbose correctMkdir C:\Users\w10\AppData\Roaming\npm-cache_locks correctMkdir not in flight; initializing
31 verbose lock using C:\Users\w10\AppData\Roaming\npm-cache_locks\staging-db89fdc7e2954f2d.lock for C:\Users\w10\AppData\Roaming\npm\node_modules.staging
32 silly doParallel extract 1
33 silly extract [email protected]
34 silly pacote trying n@latest by hash: sha512-VN3To6jBHSdTHmv+fT00V1nBdj3MWdcOlEKBEaUtXKRqQhuN289B9Jym9P/L3rXfafAsapmh4Fcr/DUR8DGJVg==
35 silly pacote data for sha512-VN3To6jBHSdTHmv+fT00V1nBdj3MWdcOlEKBEaUtXKRqQhuN289B9Jym9P/L3rXfafAsapmh4Fcr/DUR8DGJVg== not present. Using manifest.
36 http fetch GET 200 https://registry.npmjs.org/n/-/n-2.1.8.tgz 30ms
37 silly pacote n@latest extracted in 36ms
38 silly doReverseSerial unbuild 8
39 silly doSerial remove 8
40 silly doSerial move 8
41 silly doSerial finalize 8
42 silly finalize C:\Users\w10\AppData\Roaming\npm\node_modules\n
43 silly doParallel refresh-package-json 1
44 silly refresh-package-json C:\Users\w10\AppData\Roaming\npm\node_modules\n
45 verbose unlock done using C:\Users\w10\AppData\Roaming\npm-cache_locks\staging-db89fdc7e2954f2d.lock for C:\Users\w10\AppData\Roaming\npm\node_modules.staging
46 verbose stack Error: Unsupported platform for [email protected]: wanted {"name":"n","description":"Interactively Manage All Your Node Versions","version":"2.1.8","author":{"name":"TJ Holowaychuk","email":"[email protected]"},"homepage":"https://github.com/tj/n","bugs":{"url":"https://github.com/tj/n/issues"},"contributors":[{"name":"Travis Webb","email":"[email protected]","url":"tjw.io"},{"name":"Nimit Kalra","email":"[email protected]","url":"http://nimit.io"},{"name":"Troy Connor","email":"[email protected]","url":"https://github.com/troy0820"}],"keywords":["nvm","node","version","manager","switcher","node","binary","env"],"bin":{"n":"./bin/n"},"repository":{"type":"git","url":"git://github.com/tj/n.git"},"preferGlobal":true,"os":["!win32"],"engines":{"node":"*"},"license":"MIT","_resolved":"https://registry.npmjs.org/n/-/n-2.1.8.tgz","_integrity":"sha512-VN3To6jBHSdTHmv+fT00V1nBdj3MWdcOlEKBEaUtXKRqQhuN289B9Jym9P/L3rXfafAsapmh4Fcr/DUR8DGJVg==","_from":"n","_id":"[email protected]","bundleDependencies":false,"deprecated":false,"_shasum":"9b770f6ae0a93c49c64fb614625a63cc5a22d1fd","_requested":{"type":"tag","registry":true,"raw":"n","name":"n","escapedName":"n","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_spec":"n","_where":"C:\Users\w10\Documents\cfg\myscripts\bin"} (current: {"os":"win32","cpu":"x64"})
46 verbose stack at checkPlatform (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\npm-install-checks\index.js:45:14)
46 verbose stack at tryCatcher (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
46 verbose stack at ret (eval at makeNodePromisifiedEval (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promisify.js:184:12),
46 verbose stack at readJson.then.catch.then (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\lib\install\action\refresh-package-json.js:31:12)
46 verbose stack at tryCatcher (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
46 verbose stack at Promise._settlePromiseFromHandler (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
46 verbose stack at Promise._settlePromise (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
46 verbose stack at Promise._settlePromise0 (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
46 verbose stack at Promise._settlePromises (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
46 verbose stack at Promise._fulfill (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
46 verbose stack at Promise._settlePromise (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:582:21)
46 verbose stack at Promise._settlePromise0 (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
46 verbose stack at Promise._settlePromises (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
46 verbose stack at Promise._fulfill (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:638:18)
46 verbose stack at Promise._resolveCallback (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:432:57)
46 verbose stack at Promise._settlePromiseFromHandler (C:\Users\w10\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:524:17)
47 verbose pkgid [email protected]
48 verbose cwd C:\Users\w10\Documents\cfg\myscripts\bin
49 verbose Windows_NT 10.0.16299
50 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\w10\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "n"
51 verbose node v9.2.0
52 verbose npm v5.7.1
53 error code EBADPLATFORM
54 error notsup Unsupported platform for [email protected]: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
55 error notsup Valid OS: !win32
55 error notsup Valid Arch: any
55 error notsup Actual OS: win32
55 error notsup Actual Arch: x64
56 verbose exit [ 1, true ]
Duplicate: https://github.com/tj/n/issues/435
tl;dr
n doesn't support windows, or at least not x64 but brodybits on that issue mentioned https://github.com/jasongin/nvs
Thanks for the response, appreciated! Wish I'd realised that Windows wasn't supported - maybe make the error message clearer?
And still not fixed, or even adding a clearer message in mid 2019.
For the interest of future readers of this closed bug, and for @j2l.
n is written as a bash script. On plain Windows there is no bash shell, so n can not run. What we do is specify in our npm package.json that we do not support Windows, and the error and error message are handled by npm itself. We don't have any control over the message.
Could be important: On Windows there is the possibility to execute bash scripts using git for Windows bash or cygwin.
But perhaps there are other reasons n isn't usable on Windows...
And exactly how do I find where this is being requested or how can I exclude it. I don't see [email protected] in my package.json nor when I search the entire project. But I'm getting this error on a Windows 10 box and need to resolve it. Thanks
Hi @kthorne1 , you can list dependencies of a package using npm ls, and to see usage of n:
npm ls n
I got exactly the same error, by running npm install -g n in my git bash. It worked for me to update node with the .msi-installer on nodejs.org.
Most helpful comment
Thanks for the response, appreciated! Wish I'd realised that Windows wasn't supported - maybe make the error message clearer?