Open MaxHillebrand opened 3 years ago
npm install -g react-app-rewired
Thanks @Evanfeenstra for the quick feedback.
I can run the command without the -g
flag successfully,
$ /usr/node-v14.16.0-linux-x64/bin/npm install react-app-rewired
npm WARN saveError ENOENT: no such file or directory, open '/home/user/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/user/package.json'
npm WARN react-app-rewired@2.1.8 requires a peer of react-scripts@>=2.1.3 but none is installed. You must install peer dependencies yourself.
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.
but with the -g
flag it fails because no permissions.
$ /usr/node-v14.16.0-linux-x64/bin/npm install -g react-app-rewired
npm WARN checkPermissions Missing write access to /home/user/lib/node_modules
npm WARN react-app-rewired@2.1.8 requires a peer of react-scripts@>=2.1.3 but none is installed. You must install peer dependencies yourself.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /home/user/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/home/user/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/home/user/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/home/user/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2021-03-22T16_40_00_634Z-debug.log
but when I run it as root, I get the following.
sudo /usr/node-v14.16.0-linux-x64/bin/npm run build
/usr/bin/env: ‘node’: No such file or directory
I simply extracted the /usr/node-v14.16.0-linux-x64.tar.xz
file and moved it with sudo mv node-v14.16.0-linux-x64.tar.xz /usr/
. This works to use npm for the user account, but apparently not for root user.
This is probably a bad n00b mistake, but can you please help me with the troubleshooting?
You might need to setup a symlink. Can you run this command and report the output?:
whereis node nodejs
$ whereis node nodejs
node:
nodejs:
$ whereis /usr/node-v14.16.0-linux-x64/bin/npm
npm:
seems there are no symlinks setup @orthzar, how do I set this up?
Let's back up a bit. Have you tried installing NodeJS via your package manager? (e.g. sudo apt-get install npm
on Debian/Ubuntu/Mint)
The package manager will solve most, if not all, of the problems you're dealing with.
After sudo apt-get install npm
, I always get when i run npm
:
npm WARN npm npm does not support Node.js v10.24.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
Even if I continue with sudo npm install -g react-app-rewired
and sudo npm run build
, it fails with
npm ERR! path /home/user/sphinx-android/run/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/user/sphinx-android/run/package.json'
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/2021-04-06T16_15_49_630Z-debug.log
There's this in the README, but I have no idea what I should do here.
package.json postinstall script: electron-builder install-app-deps --platform=linux
@Evanfeenstra can you take a look at this?
I got the latest nodejs and followed the README instructions for Desktop build on Linux, with npm binaries from the freshly installed tar package in
/usr/
.I get the following errors and am not sure how to work around them.
Any ideas?