Flood-UI / flood

A web UI for rTorrent, qBittorrent and Transmission with a Node.js backend and React frontend. Migrate to v4: https://github.com/jesec/flood/wiki/Migrate-from-older-versions-of-Flood.
https://flood.js.org
GNU General Public License v3.0
1.81k stars 173 forks source link

npm install failed #531

Closed NoeelMoeskops closed 6 years ago

NoeelMoeskops commented 6 years ago
$ npm install --production  

> argon2@0.16.2 install /opt/flood/node_modules/argon2
> node-gyp rebuild

make: Entering directory '/opt/flood/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
make: cc: Command not found
make: *** [libargon2.target.mk:112: Release/obj.target/libargon2/argon2/src/opt.o] Error 127
make: Leaving directory '/opt/flood/node_modules/argon2/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:135:13)
gyp ERR! stack     at ChildProcess.emit (events.js:224:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.12.14-300.fc26.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/flood/node_modules/argon2
gyp ERR! node -v v9.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
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"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon2@0.16.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the argon2@0.16.2 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!     /home/noeel/.npm/_logs/2017-11-11T16_35_40_311Z-debug.log

OS: Fedora 26, tried node 6, 7 and 9

noraj commented 6 years ago

argon2

Before installing

You MUST have a node-gyp global install before proceeding with install, along with GCC >= 4.8 / Clang >= 3.3.

node-argon2 works only and is tested against Node >=4.0.0.

Plus other stuff for Windows and OSX.

@jfurrow README needs to be updated. (Lacks of documentation again, I'm only telling that in order to highlight the importance fo #385).

noraj commented 6 years ago

@jfurrow The PR with argon2 should have needed a minor release (1.1.0) and a special note to update from 1.0.0.

noraj commented 6 years ago

I followed https://github.com/jfurrow/flood#updating + npm install -g node-gyp before npm i and check gcc.

I got this error:

sudo npm i                                                                                                                                                                      shark@rawsec

> argon2@0.16.2 install /srv/flood/node_modules/argon2
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Python executable "/usr/bin/python" is v3.6.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:264:7)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Linux 3.14.32-xxxx-grs-ipv6-64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /srv/flood/node_modules/argon2
gyp ERR! node -v v8.8.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
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"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon2@0.16.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the argon2@0.16.2 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!     /root/.npm/_logs/2017-11-11T17_33_10_314Z-debug.log

Because on archlinux default python is python3 and gyp need python2. The solution on arch is sudo pacman -S python2 and then sudo npm i --python="/usr/bin/python2" --unsafe-perm (see here for why --unsafe-perm) .

noraj commented 6 years ago

@jfurrow see PR #532

d0tfile commented 6 years ago

One more thing: flag "--production" is not supported right now. You will get errors on "npm run build" stage. Do it like README says: "npm install" and "npm run build".

NoeelMoeskops commented 6 years ago

Thanks for your reply's. I installed gcc, clang and node-gyp. But my instalation still has errors:

╭─noeel@fedora.localdomain /opt/flood  ‹master*› 
╰─➤  sudo npm install -g node-gyp
/usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js
/usr/lib
└── node-gyp@3.6.2 

╭─noeel@fedora.localdomain /opt/flood  ‹master*› 
╰─➤  npm install argon2

> argon2@0.16.2 install /opt/flood/node_modules/argon2
> node-gyp rebuild

make: Entering directory '/opt/flood/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  AR(target) Release/obj.target/argon2.a
  COPY Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
In file included from ../../nan/nan.h:192:0,
                 from ../src/argon2_node.h:5,
                 from ../src/argon2_node.cpp:8:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:73: warning: ‘v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’ is deprecated: Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
                                                                         ^
In file included from /home/noeel/.node-gyp/9.1.0/include/node/v8.h:26:0,
                 from /home/noeel/.node-gyp/9.1.0/include/node/node.h:63,
                 from ../src/argon2_node.cpp:1:
/home/noeel/.node-gyp/9.1.0/include/node/v8.h:3115:29: note: declared here
                 Maybe<bool> ForceSet(Local<Context> context, Local<Value> key,
                             ^
/home/noeel/.node-gyp/9.1.0/include/node/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/argon2.node
  COPY Release/argon2.node
make: Leaving directory '/opt/flood/node_modules/argon2/build'
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"})

+ argon2@0.16.2
added 117 packages in 121.63s
╭─noeel@fedora.localdomain /opt/flood  ‹master*› 
╰─➤  npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 115 packages in 95.57s
╭─noeel@fedora.localdomain /opt/flood  ‹master*› 
╰─➤  npm run build

> flood@1.0.0 build /opt/flood
> node client/scripts/build.js

Creating an optimized production build...
Failed to compile.

./client/src/sass/style.scss
Module build failed: Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (59)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.5.3

./client/src/sass/style.scss
Module build failed: ModuleBuildError: Module build failed: Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (59)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.5.3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! flood@1.0.0 build: `node client/scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the flood@1.0.0 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!     /home/noeel/.npm/_logs/2017-11-12T16_42_03_013Z-debug.log
╭─noeel@fedora.localdomain /opt/flood  ‹master*› 
╰─➤  npm start                                                                                                                                                                                                 1 ↵

> flood@1.0.0 start /opt/flood
> node server/bin/start.js

Failed to start web server:
Error: Cannot find module '/opt/flood/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! flood@1.0.0 start: `node server/bin/start.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the flood@1.0.0 start 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!     /home/noeel/.npm/_logs/2017-11-12T16_42_33_451Z-debug.log
noraj commented 6 years ago

@Noedel-Man 1) You don't need two C compiler (gcc and clang): just one is enough. For example keep gcc and uninstall clang. 2) If install fails why do you try to start flood anyway? 3) Is your gcc > 4.8? (gcc --version) 4) For npm run build see issue #533

noraj commented 6 years ago

@Noedel-Man Please, start over from the beginning and do exactly what the README says. You may want to close this issue and open a new one if you encounter problems in your next install.

jfurrow commented 6 years ago

Thanks @noraj1337!

jfurrow commented 6 years ago

@Noedel-Man Please follow @noraj1337's advice.

hopeseekr commented 6 years ago

Here's my fix for this issue:

https://stackoverflow.com/a/47427544/430062

paulvandenburg commented 6 years ago

I had a similar issue, eventually after making sure I had the following packages installed it worked: sudo apt install g++ argon2 gcc make