Closed MarkLyck closed 4 years ago
Not entirely sure why this fails it should come with prebuilds. Especially on Mac OS X. It might be trying to install an old version?
Unless you're running 32-bit it should be there: https://unpkg.com/browse/@parcel/source-map@2.0.0-alpha.4.6/prebuilds/darwin-x64/
I'm on MacOS Catalina 10.15.3
I do see the prebuilds in my node_modules as well.
~(The node-gyp error seems to be related to Python 2/3, somehow only Python 2 is supported?) https://github.com/atom/git-utils/issues/72#issuecomment-263755735~
Python 2 indeed being used...
@mischnic any clue why it's even running node-gyp rebuild
in the first place?
No.
@MarkLyck
Does the file /Users/xxx/.config/yarn/global/node_modules/@parcel/source-map/prebuilds/darwin-x64/node.napi.glibc.node
exist?
What does invoking yarn node-gyp-build-test
in /Users/xxx/.config/yarn/global/node_modules/@parcel/source-map
print? It should print nothing and if the prebuilds couldn't be found Error: No native build was found for ...
.
@mischnic
Yes /node_modules/@parcel/source-map/prebuilds/darwin-x64/node.napi.glibc.node
does exist
running that in source-map:
yarn node-gyp-build-test
yarn run v1.17.3
$ /Users/xxx/colony/colony-app/node_modules/@parcel/source-map/node_modules/.bin/node-gyp-build-test
✨ Done in 0.48s.
@DeMoorJasper No idea
Running into this error in windows because it is looking for python. Is python a dependency to install parcel2?
error C:\Users\user\code\parcelv2\node_modules\@parcel\source-map: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\user\code\parcelv2\node_modules\@parcel\source-map
Output:
C:\Users\user\code\parcelv2\node_modules\@parcel\source-map>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\user\code\parcelv2\node_modules\@parcel\source-map
gyp ERR! node -v v10.16.0
@aarjithn it is for building native node modules using node-gyp but that should not be necessary on windows, mac, linux and alpine linux. I have no clue why it is even running node-gyp in the first place especially rebuild, it should just detect a prebuild and use that
Thanks @DeMoorJasper, makes sense.
I can confirm /node_modules/@parcel/source-map/prebuilds/win32-x64/node.napi.glibc.node
is present, also running yarn node-gyp-build-test
says Done in 0.31s
.
(Previously I ran the command incorrectly. Have edited comment to avoid confusion, thanks again @DeMoorJasper
@aarjithn I think you ran that command in your project and not inside the folder where source-map has been installed. You should run that command in <your project directory>/node_modules/@parcel/source-map
This is the package.json of @parcel/source-map@2.0.0-alpha.4.7
that npm installs:
There is a "install": "node-gyp rebuild"
script that we did not specify
{
// ...
"license": "MIT",
"main": "./dist/node.js",
"name": "@parcel/source-map",
"scripts": {
"benchmark": "npm run benchmark:node && npm run benchmark:wasm",
"benchmark:node": "cross-env BACKEND=node node ./bench/run",
"benchmark:wasm": "cross-env BACKEND=wasm node ./bench/run",
"build:dev": "node-gyp rebuild --debug",
"compile-wasm": "make",
"install": "node-gyp rebuild", /// <<-------- where does this come from?
"lint": "prettier --write src/*.js",
"postinstall": "node-gyp-build",
"prebuild": "prebuildify --napi --strip --tag-libc",
"prepublish": "npm run transpile",
"rebuild": "rm -rf build && yarn build:dev",
"test": "npm run test:node && npm run test:wasm",
"test:node": "cross-env BACKEND=node mocha ./test/*.test.js",
"test:wasm": "cross-env BACKEND=wasm mocha ./test/*.test.js",
"transpile": "babel ./src/*.js --out-dir ./dist && flow-copy-source -v src dist",
"typecheck": "flow"
},
"version": "2.0.0-alpha.4.7"
}
Compare to: https://unpkg.com/browse/@parcel/source-map@2.0.0-alpha.4.7/package.json
Great, npm adds this as a default value: https://docs.npmjs.com/misc/scripts#default-values
@mischnic wow that's strange, npm shouldn't be modifying anything to a deploy... anyway great discovery will merge your PR and close of this issue :)
npm shouldn't be modifying anything to a deploy
(This happens during npm install
)
🐛 bug report
Cannot install the latest @next version of parcel.
parcel@2.0.0-alpha.3.2
an error occurs in the source-map script.
🤔 Expected Behavior
parcel should install
😯 Current Behavior
yarn add parcel@2.0.0-alpha.3.2 fails npm install parcel@2.0.0-alpha.3.2 fails
🔦 Context
LOG:
🌍 Your Environment
yarn global v1.17.3