avh4 / elm-upgrade

Upgrade Elm projects

Home Page:https://www.npmjs.com/package/elm-upgrade

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't install from npm

Kurren123 opened this issue · comments

System: windows 10
npm version:

{ npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '30.0.3',
  http_parser: '2.7.0',
  icu: '58.2',
  modules: '51',
  node: '7.9.0',
  openssl: '1.0.2k',
  tz: '2016j',
  unicode: '9.0',
  uv: '1.11.0',
  v8: '5.5.372.43',
  zlib: '1.2.11' }

When I run npx elm-upgrade

Cannot find module 'C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\elm-upgrade\upgrade.js'

And npm install -g elm-upgrade

C:\Users\Kurren Nischal\AppData\Roaming\npm\elm-upgrade -> C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\elm-upgrade\upgrade.js

> syncprompt@2.0.0 install C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\elm-upgrade\node_modules\syncprompt
> node-gyp rebuild


C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\elm-upgrade\node_modules\syncprompt>if not defined npm_config_node_gyp (node "C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Kurren Nischal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Kurren Nischal\AppData\Roaming\npm\node_modules\elm-upgrade\node_modules\syncprompt
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! syncprompt@2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the syncprompt@2.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Kurren Nischal\AppData\Roaming\npm-cache\_logs\2018-09-10T17_25_43_592Z-debug.log

I do have python installed and it's on my PATH

Hopefully this was fixed in #67.

Can you try npx -p git://github.com/avh4/elm-upgrade.git#master elm-upgrade or npm install -g git://github.com/avh4/elm-upgrade.git#master and see if that works?

Thanks for your response

I now get the following error, I'm guessing because there's a space in the folder path that hasn't been escaped:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "Nischal\AppData\Roaming\npm-cache\_npx\2960" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Kurren Nischal\AppData\Roaming\npm-cache\_logs\2018-09-11T08_42_00_265Z-debug.log
Install for git://github.com/avh4/elm-upgrade.git#master failed with code 1

I'm guessing the folder it's looking for is

C:\Users\Kurren Nischal\AppData\Roaming\npm-cache\_npx\2960

Hmm, I'm not sure what that error means.. Maybe the npm/npx cache is corrupted? Which of the comments in #69 (comment) did you try?

npx -p git://github.com/avh4/elm-upgrade.git#master elm-upgrade produced the error code. I tried npm install -g and it worked, thanks for your help!

@Kurren123 thanks for reporting.

npm i -g elm-upgrade

worked for me as well.

I'm experiencing the same syncprompt native compilation problem with npx elm-upgrade@latest or npm i -g elm-upgrade@latest on Windows 10.

Did the #67 not make it to the npm feed or am I somehow getting an old version? NPM package is still version 0.19.6, which explains that. See #77.