graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

Error on install - prepublish.sh

Open dybzon opened this issue 8 years ago • 3 comments

I've tried following the install guide.

When I run npm install I receive this error:

Failed at the [email protected] prepublish script '. ./resources/prepublish.sh'. Make sure you have the latest version of node.js and npm installed. If you do, this is most likely a problem with the graphiql package, not with npm itself. Tell the author that this fails on your system:. ./resources/prepublish.sh

I do have the latest version of npm installed.

Here is what I've done: git clone https://github.com/graphql/graphiql.git cd graphiql npm install

Error log is attached. npm-debug.log

Are there any pre-requisites I need to install first, or what am I missing?

dybzon avatar Jan 21 '18 17:01 dybzon

Hey @dybzon

Cool that you tried getting it started, I can see that you are using an older version of Node, could you try with the latest version 9?

2 info using [email protected]
3 info using [email protected]

kevinsimper avatar Feb 05 '18 14:02 kevinsimper

I ran into this as well while trying to install graphiQL on Bash on Ubuntu on Windows.

using node 9.5.0 and npm 5.6.0 produces the following:

npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!

> [email protected] install /mnt/d/workspace/Codepile Workspace/queryEditor/node_modules/graphiql/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
trying to install from sub 'node_module' directory, skipping Git hooks installation
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> [email protected] prepublish /mnt/d/workspace/Codepile Workspace/queryEditor/node_modules/graphiql
> . ./resources/prepublish.sh

sh: 1: .: Can't open ./resources/prepublish.sh
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prepublish: `. ./resources/prepublish.sh`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] prepublish 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:

Relevant snip from debug log:

26293 verbose lifecycle [email protected]~prepublish: CWD: ...SOME_PATH.../node_modules/graphiql
26294 silly lifecycle [email protected]~prepublish: Args: [ '-c', '. ./resources/prepublish.sh' ]
26295 silly lifecycle [email protected]~prepublish: Returned: code: 2  signal: null
26296 info lifecycle [email protected]~prepublish: Failed to exec prepublish script
26297 verbose stack Error: [email protected] prepublish: `. ./resources/prepublish.sh`
26297 verbose stack Exit status 2
26297 verbose stack     at EventEmitter.<anonymous> (...SOME_PATH.../.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
26297 verbose stack     at EventEmitter.emit (events.js:160:13)
26297 verbose stack     at ChildProcess.<anonymous> (...SOME_PATH.../.nvm/versions/node/v9.5.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
26297 verbose stack     at ChildProcess.emit (events.js:160:13)
26297 verbose stack     at maybeClose (internal/child_process.js:943:16)
26297 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
26298 verbose pkgid [email protected]
26299 verbose cwd ...SOME_PATH.../node_modules/graphiql
26300 verbose Linux 4.4.0-43-Microsoft
26301 verbose argv "...SOME_PATH.../.nvm/versions/node/v9.5.0/bin/node" "...SOME_PATH.../.nvm/versions/node/v9.5.0/bin/npm" "install"
26302 verbose node v9.5.0
26303 verbose npm  v5.6.0
26304 error code ELIFECYCLE
26305 error errno 2
26306 error [email protected] prepublish: `. ./resources/prepublish.sh`
26306 error Exit status 2
26307 error Failed at the [email protected] prepublish script.
26307 error This is probably not a problem with npm. There is likely additional logging output above.
26308 verbose exit [ 2, true ]

Downgrading to npm 4.6.1 produces:

npm WARN lifecycle [email protected]~prepublish: cannot run in wd %s %s (wd=%s) [email protected] . ./resources/prepublish.sh /mnt/d/workspace/Codepile Workspace/queryEditor/node_modules/graphiql
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of react@^15.6.0 || ^16.0.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@^15.6.0 || ^16.0.0 but none was installed.
npm WARN [email protected] requires a peer of react@^15.6.1 but none was installed.

> [email protected] build /mnt/d/workspace/Codepile Workspace/queryEditor/node_modules/graphiql
> bash ./resources/build.sh

bash: ./resources/build.sh: No such file or directory
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] build: `bash ./resources/build.sh`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build 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:

after that, manually running ./resources/build.sh worked for me.

aianta avatar Feb 17 '18 22:02 aianta

@aianta Ah, I can see there is a problem, but you should use yarn as described here because the lock file is in yarn.lock and there is no npm-lock.json

https://github.com/graphql/graphiql/blob/master/CONTRIBUTING.md#getting-started

kevinsimper avatar Feb 19 '18 16:02 kevinsimper