GolosChain / golos-js

Golos.js the JavaScript API for Golos blockchain
10 stars 8 forks source link

Не могу установить golos-js как модуль npm #8

Closed On1x closed 7 years ago

On1x commented 7 years ago

Пишу приложение для мониторинга steem и golos. Для мониторинга хотел использовать golos-js, но не могу установить нормально с помощью npm, вываливаются ошибки:

root@server0 /var/www/nodejs/HiddenEngine # npm install https://github.com/GolosChain/golos-js.git

> golos-js@0.5.27 postinstall /var/www/nodejs/HiddenEngine/node_modules/golos-js
> postinstall-build lib && cross-env scripts/post-install.js

postinstall-build:
  This version of npm (5.4.2) may not be compatible with postinstall-build! There
  are outstanding bugs in certain versions of npm that prevent it from working with
  postinstall-build. See https://github.com/exogen/postinstall-build#bugs-in-npm
  for more information.

npm WARN deprecated babel-preset-es2017@6.24.1: We're really excited that you're trying to use ES2017 syntax, but instead of making more yearly presets, Babel has a better preset that we recommend you use instead: npm install babel-preset-env --save-dev. Give us a follow @babeljs to get more updates
npm WARN lifecycle golos-js@0.5.27~postinstall: cannot run in wd %s %s (wd=%s) golos-js@0.5.27 postinstall-build lib && cross-env scripts/post-install.js /var/www/nodejs/HiddenEngine/node_modules/golos-js
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.
npm WARN lifecycle golos-js@0.5.27~prepublish: cannot run in wd %s %s (wd=%s) golos-js@0.5.27 npm run build /var/www/nodejs/HiddenEngine/node_modules/golos-js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN The package bluebird is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 564 packages in 7.618s

> golos-js@0.5.27 build /var/www/nodejs/HiddenEngine/node_modules/golos-js
> npm run build-browser && npm run build-node

> golos-js@0.5.27 build-browser /var/www/nodejs/HiddenEngine/node_modules/golos-js
> rm -rf dist && NODE_ENV=production webpack && gzip -k -f ./dist/*.js && du -h ./dist/*

Hash: a98b1c86d0e44ce98a4d
Version: webpack 1.15.0
Time: 17ms

ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' /var/www/nodejs/HiddenEngine/node_modules/golos-js/src/browser.js in /var/www/nodejs/HiddenEngine/node_modules/golos-js

ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' /var/www/nodejs/HiddenEngine/node_modules/golos-js/test/api.test.js in /var/www/nodejs/HiddenEngine/node_modules/golos-js
gzip: ./dist/*.js: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! golos-js@0.5.27 build-browser: `rm -rf dist && NODE_ENV=production webpack && gzip -k -f ./dist/*.js && du -h ./dist/*`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the golos-js@0.5.27 build-browser 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/2017-09-15T06_00_17_839Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! golos-js@0.5.27 build: `npm run build-browser && npm run build-node`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the golos-js@0.5.27 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:
npm ERR!     /root/.npm/_logs/2017-09-15T06_00_17_915Z-debug.log
postinstall-build:
  Error: Command failed: sh -c "/root/.nvm/versions/node/v8.4.0/bin/node" "/root/.nvm/versions/node/v8.4.0/lib/node_modules/npm/bin/npm-cli.js" run build

npm WARN hidden_engine@0.0.1 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! golos-js@0.5.27 postinstall: `postinstall-build lib && cross-env scripts/post-install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the golos-js@0.5.27 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/2017-09-15T06_00_27_244Z-debug.log

Пытался установить мастер ветку через git clone + npm install, вот что получаю:

1315 info lifecycle secure-random@1.1.1~postinstall: secure-random@1.1.1
1316 silly postinstall ws@1.1.4
1317 info lifecycle ws@1.1.4~postinstall: ws@1.1.4
1318 silly postinstall golos-js@0.5.27
1319 info lifecycle golos-js@0.5.27~postinstall: golos-js@0.5.27
1320 verbose lifecycle golos-js@0.5.27~postinstall: unsafe-perm in lifecycle false
1321 verbose lifecycle golos-js@0.5.27~postinstall: PATH: /root/.nvm/versions/node/v8.4.0/lib/node_modules/npm/bin/node-gyp-bin:/root/.nvm/versions/node/v8.4.0/lib/node_modules/golos-js/node_modules/.bin:/root/.nvm/versions/node/v8.4.0/lib/node_modules/.bin:/root/.nvm/versions/node/v8.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
1322 verbose lifecycle golos-js@0.5.27~postinstall: CWD: /root/.nvm/versions/node/v8.4.0/lib/node_modules/golos-js
1323 silly lifecycle golos-js@0.5.27~postinstall: Args: [ '-c',
1323 silly lifecycle   'postinstall-build lib && cross-env scripts/post-install.js' ]
1324 info lifecycle golos-js@0.5.27~postinstall: Failed to exec postinstall script
1325 verbose unlock done using /root/.npm/_locks/staging-71f0213a84df8e63.lock for /root/.nvm/versions/node/v8.4.0/lib/node_modules/.staging
1326 warn /var/www/nodejs/golos-js/node_modules/base64-js is not a child of /root/.nvm/versions/node/v8.4.0/lib
1327 verbose stack Error: golos-js@0.5.27 postinstall: `postinstall-build lib && cross-env scripts/post-install.js`
1327 verbose stack spawn ENOENT
1327 verbose stack     at ChildProcess.<anonymous> (/root/.nvm/versions/node/v8.4.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
1327 verbose stack     at emitTwo (events.js:125:13)
1327 verbose stack     at ChildProcess.emit (events.js:213:7)
1327 verbose stack     at maybeClose (internal/child_process.js:927:16)
1327 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
1328 verbose pkgid golos-js@0.5.27
1329 verbose cwd /var/www/nodejs/golos-js
1330 verbose Linux 4.8.0-58-generic
1331 verbose argv "/root/.nvm/versions/node/v8.4.0/bin/node" "/root/.nvm/versions/node/v8.4.0/bin/npm" "install" "--global"
1332 verbose node v8.4.0
1333 verbose npm  v5.4.2
1334 error file sh
1335 error code ELIFECYCLE
1336 error errno ENOENT
1337 error syscall spawn
1338 error golos-js@0.5.27 postinstall: `postinstall-build lib && cross-env scripts/post-install.js`
1338 error spawn ENOENT
1339 error Failed at the golos-js@0.5.27 postinstall script.
1339 error This is probably not a problem with npm. There is likely additional logging output above.
1340 verbose exit [ 1, true ]
kv-gits commented 7 years ago

а) в package.json попробуйте так "golos": "GolosChain/golos-js", б) Если дебиан, то там ноду лучше ставить через nvm

On1x commented 7 years ago

@kv-gits не помогло, прикладываю скриншот, сыпится все на rm -rf dist && NODE_ENV=production webpack && gzip -k -f ./dist/*.js && du -h ./dist/* и npm run build-browser && npm run build-node

postinstall-build:
  Error: Command failed: sh -c "/root/.nvm/versions/node/v8.4.0/bin/node" "/root/.nvm/versions/node/v8.4.0/lib/node_modules/npm/bin/npm-cli.js" run build
kv-gits commented 7 years ago

У меня тоже самое вылезло. Хотя до этого работало.

b1acksun commented 7 years ago

скрипт postinstall временно вырезал, он был нужен для патча react-native билиотеки