eykrehbein / strest

⚡️ CI-ready tests for REST APIs configured in YAML
MIT License
1.74k stars 59 forks source link

Add npm auto-deploy via TravisCI #107

Closed eykrehbein closed 5 years ago

eykrehbein commented 5 years ago

There was also another important change. The package name strest-cli is now deprecated. The new reference is @strest/cli

philippevk commented 5 years ago

I get this error when trying to install with the new package name

$ npm install --save-dev '@strest/cli'
npm WARN deprecated hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN test@1.0.0 No description
npm WARN test@1.0.0 No repository field.

npm ERR! path ~/test/node_modules/@strest/cli/dist/main.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '~/test/node_modules/@strest/cli/dist/main.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 
eykrehbein commented 5 years ago

@philippevk Did you try to install the package globally?

philippevk commented 5 years ago

Just tried and it gives the same result:

npm WARN deprecated hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm ERR! path /usr/lib/node_modules/@strest/cli/dist/main.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/lib/node_modules/@strest/cli/dist/main.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-15T16_18_22_671Z-debug.log

I also tried it in a fresh npm directory with the same result

mkdir foo
cd foo
npm init
npm install `@strest/cli`

also, I asked a co-worked to try it and he had the same result.

Just a thought: there is a different package named strest in npm, maybe that's the issue (@strest and strest somehow create a conflict?)

Thanks for the fast replies btw :)

icosamuel commented 5 years ago

I also have the same problem on my setup


$ npm install '@strest/cli'
npm ERR! ~/dev/project/node_modules/@strest/cli/dist/main.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '~/dev/project/node_modules/@strest/cli/dist/main.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2018-11-15T16_20_55_719Z-debug.log
eykrehbein commented 5 years ago

I'll fix it asap!

eykrehbein commented 5 years ago

Looks like this is an issue with npm 👎 . If you have yarn, install it globally with yarn until I figured out a solution to this

eykrehbein commented 5 years ago

Ok it's fixed. Disabling auto-deploy for now - there seemed to be a bug

jgroom33 commented 5 years ago

recreation:

# I don't know what this image has, but here's what happened:
docker run -it docker:latest sh
apk update
apk add npm
npm i @strest/cli

npm WARN deprecated hoek@5.0.4: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
/usr/bin/strest -> /usr/lib/node_modules/@strest/cli/dist/main.js

> jsonpath@1.0.0 postinstall /usr/lib/node_modules/@strest/cli/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js

sh: can't create generated/aesprim-browser.js: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsonpath@1.0.0 postinstall: `node lib/aesprim.js > generated/aesprim-browser.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsonpath@1.0.0 postinstall 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!     /root/.npm/_logs/2018-11-16T06_06_26_450Z-debug.log

Workaround:

npm install -g --save-dev @strest/cli --unsafe-perm=true --allow-root

philippevk commented 5 years ago

So sorry to keep nagging you, but I still have an issue:

jgroom33 commented 5 years ago

try removing all of them and reinstall. it seems odd that there are two versions of the file

philippevk commented 5 years ago
$ mkdir strest-test && cd strest-test && npm init

$ npm install --save-dev '@strest/cli'
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.

> jsonpath@1.0.0 postinstall /home/funkymonk/dump/strest-test/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN strest-test@1.0.0 No description
npm WARN strest-test@1.0.0 No repository field.

+ @strest/cli@1.18.2
added 77 packages from 95 contributors in 10.865s

$ grep 'removeFilename =' node_modules/@strest/cli/src/yaml-parse.ts 
        const removeFilename = path.dirname(filePath) + path.sep;

$ grep 'removeFilename =' node_modules/@strest/cli/dist/yaml-parse.js 
                var removeFilename = filePath.substring(0, filePath.lastIndexOf("/") + 1);
jgroom33 commented 5 years ago

npm install -g --save-dev @strest/cli --unsafe-perm=true --allow-root

philippevk commented 5 years ago

done, but same issue (now installed globally)

$ grep 'removeFilename = ' /usr/lib/node_modules/@strest/cli/src/yaml-parse.ts 
        const removeFilename = path.dirname(filePath) + path.sep;

$ grep 'removeFilename = ' /usr/lib/node_modules/@strest/cli/dist/yaml-parse.js 
                var removeFilename = filePath.substring(0, filePath.lastIndexOf("/") + 1);
jgroom33 commented 5 years ago

@eykrehbein is it possible that version 1.18.2 that was pushed to npm is not actually 1.18.2?

eykrehbein commented 5 years ago

I'm sorry about this issue. I just forgot to compile the code before uploading. (tsc) It's fixed now in the latest release. If not, feel free to contact us again @philippevk

philippevk commented 5 years ago

it's all good now :) thanks for fixing it