Closed average-everyman closed 3 years ago
by the way, I also tried npm install --force
and npm install --legacy-peer-deps
- and both give me the same output as above
That's strange. Try removing the postinstall
line from package.json and see if it works.
If that works, can try to identify what script is causing the error?
You could do that by running the command that postinstall
runs directly, like...
npm run npm-run-all build-css
npm run build-css
thanks for your prompt reply, unfortunately removing postinstall
line from package.json
did not work, still getting the same output as above for npm install
. also if I run it using sudo
and/or the --force
flag
npm install
, then this error appearnpm i node-sass-chokidar
. It solves this problemnpm run build
that's itHi, i have a similar issue, just in my case I didn't have python installed before (I assume you have it installed) So a different Error occurred at first. The error seemed to expect python, so I tried installing it. On my second install attempt the error resembled the one from OP.
To reproduce, you could try uninstalling python.
I put my error logs into gists to keep this thread a bit cleaner. In both examples I simply ran npm i
Error before pyton was installed Error after python was installed
So apparently both python and make must be installed on the system to run the gyp node package. (I tested only on Ubuntu)
Python can be installed via sudo apt-get install python
(python2 is required)
Make can be installed via the build essentials sudo apt-get install build-essential
The readme could help on windows too
I solved this by doing the following:
nvm install 8.10.0
nvm use
npm install
I'm experiencing the same issue with the ZIP package downloaded directly from AppSearch.
I tried to force python version using npm install --python=python3.9
which wasn't successful:
npm install --python=python3.9
npm WARN deprecated domelementtype@1.3.0: update to domelementtype@1.3.1
npm WARN deprecated request-promise-native@1.0.8: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated fsevents@2.1.2: "Please update to latest v2.3 or v2.2"
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated eslint-loader@3.0.3: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated html-webpack-plugin@4.0.0-beta.11: please switch to a stable version
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated core-js@2.5.7: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /Users/<PATH>/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/Cellar/node/16.5.0/bin/node /Users/<PATH>/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/local/Cellar/node/16.5.0/bin/node',
npm ERR! gyp verb cli '/Users/<PATH>/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.5.0 | darwin | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python3.9" in the PATH
npm ERR! gyp verb `which` succeeded python3.9 /usr/local/bin/python3.9
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /usr/local/bin/python3.9 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack at Socket.<anonymous> (node:internal/child_process:453:11)
npm ERR! gyp ERR! stack at Socket.emit (node:events:394:28)
npm ERR! gyp ERR! stack at Pipe.<anonymous> (node:net:672:12)
npm ERR! gyp ERR! System Darwin 20.4.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/16.5.0/bin/node" "/Users/<PATH>/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /Users/<PATH>/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.5.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
Doing some online searching, I found the following the following command npm install -g --unsafe-perm node-sass --save
which seems to installed required packages
npm install -g --unsafe-perm node-sass --save
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
changed 209 packages, and audited 210 packages in 6s
12 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Running npm run build
resulting in build-css
failing:
npm run build
> app-search-reference-ui-react@1.2.0 build
> npm-run-all build-css build-js
> app-search-reference-ui-react@1.2.0 build-css
> node-sass-chokidar src/ -o src/
sh: node-sass-chokidar: command not found
ERROR: "build-css" exited with 127.
Running npm start
failed starting the react-scripts
npm start
> app-search-reference-ui-react@1.2.0 start
> react-scripts start
sh: react-scripts: command not found
At this stage still haven't found a solution for the aforementioned issues.
I'm experiencing the same issue with the ZIP package downloaded directly from AppSearch.
While I haven't been able to make the reference UI running on my Mac running
Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64
, I was able to run reference UI via docker using the followingdockerfile
:
FROM nikolaik/python-nodejs:latest
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]
So generally speaking, it would appear that the error is related almost entirely to the version of node-gyp
that this project is using, and the version of Python that folks have locally. This project is currently using node-gyp@3.8.0
, which is required by node-sass-chokidar
.
So generally speaking, it would appear that the error is related almost entirely to the version of
node-gyp
that this project is using, and the version of Python that folks have locally. This project is currently usingnode-gyp@3.8.0
, which is required bynode-sass-chokidar
.
That is correct, only node-gyp
is problematic and it's due to it's dependencies. As per it's doc, for Mac users Python v3.6, v3.7, v3.8, or v3.9
and Xcode
are required.
The latest
tag of the docker container I've mentioned above reflects the following versions:
Node: 14.x
npm: 6.x
yarn: stable
Python: latest
pip: latest
pipenv: latest
poetry: latest
Comparing those versions to what I have installed, the only differences are Node
and npm
. My local machine has:
node --version
v16.5.0
npm --version
7.19.1
From node-gyp
side, my installed version is v8.1.0
. Executing node-gyp list
returns ok
node-gyp list
gyp info it worked if it ends with ok
gyp info using node-gyp@8.1.0
gyp info using node@16.5.0 | darwin | x64
16.5.0
gyp info ok
My train of thought is that there might be some incompatibilities but I'm not sure which versions are incompatible with!
@christophercutajar Oh, you know what, I don't spell this out specifically in the instructions but this project requires node 8.10.0
to run. https://github.com/elastic/app-search-reference-ui-react/blob/master/.nvmrc. Can you try with that version?
@christophercutajar Actually...
Are you using this repository, or are you using code downloaded from App Search?
master
in this repository actually requires 14.17.0
, I forgot to update the .nvmrc
file.
Downloaded code from App Search v7.13 requires 8.10.0. 7.14 would require 14.17.0.
Ok this makes sense now! I've downloaded the code directly from AppSearch v7.13 and then updated the package.json
with the latest available version from Git.
I've tested this approach was able to successfully start the ReferenceUI server:
nvm install 14.17.0
nvm use 14.17.0
npm install
npm start
@JasonStoltz I can create a PR to update the docs if that helps?
That would definitely help, thanks!
And thank you for all the detailed debugging, that was a huge help 👍 👍 👍
@JasonStoltz raised https://github.com/elastic/app-search-reference-ui-react/pull/81 for your review with updated docs. Let me know should you prefer any amendments to be done.
Hello, I have local elasticsearch instance and local enterprise-search instance. In AppSearch dashboard (localhost:3002) I built a reference UI, and tried to install it (as per the README.md instruction) with
npm install
, however it does not seem to work (?). Below the terminal output:This is what's in the directory: