?
avatar C-Lodder
C-Lodder
29 Feb 2020

Steps to reproduce the issue

According to your docs: https://docs.joomla.org/J4.x:Setting_Up_Your_Local_Environment#Steps_to_Setup_the_Local_Environment

Run npm ci

Expected result

Install packages successfully from the lock file

Actual result

C:\dev\joomla4\node_modules\watchpack\node_modules\fsevents>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modul es\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nod ejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )                                                                    gyp ERR! find Python                                                                                                                     gyp ERR! find Python Python is not set from command line or npm configuration                                                            gyp ERR! find Python Python is not set from environment variable PYTHON                                                                  gyp ERR! find Python checking if "python" can be used                                                                                    gyp ERR! find Python - "python" is not in PATH or produced an error                                                                      gyp ERR! find Python checking if "python2" can be used                                                                                   gyp ERR! find Python - "python2" is not in PATH or produced an error                                                                     gyp ERR! find Python checking if "python3" can be used                                                                                   gyp ERR! find Python - "python3" is not in PATH or produced an error                                                                     gyp ERR! find Python checking if the py launcher can be used to find Python 2                                                            gyp ERR! find Python - "py.exe" is not in PATH or produced an error                                                                      gyp ERR! find Python checking if Python is C:\Python27\python.exe                                                                        gyp ERR! find Python - "C:\Python27\python.exe" could not be run                                                                         gyp ERR! find Python checking if Python is C:\Python37\python.exe                                                                        gyp ERR! find Python - "C:\Python37\python.exe" could not be run                                                                         gyp ERR! find Python                                                                                                                     gyp ERR! find Python **********************************************************                                                          gyp ERR! find Python You need to install the latest version of Python.                                                                   gyp ERR! find Python Node-gyp should be able to find and use Python. If not,                                                             gyp ERR! find Python you can try one of the following options:                                                                           gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"                                                                   gyp ERR! find Python   (accepted by both node-gyp and npm)                                                                               gyp ERR! find Python - Set the environment variable PYTHON                                                                               gyp ERR! find Python - Set the npm configuration variable python:                                                                        gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"                                                                     gyp ERR! find Python For more information consult the documentation at:                                                                  gyp ERR! find Python https://github.com/nodejs/node-gyp#installation                                                                     gyp ERR! find Python **********************************************************                                                          gyp ERR! find Python                                                                                                                     gyp ERR! configure error                                                                                                                 gyp ERR! stack Error: Could not find any Python installation to use                                                                      gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)       gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)  gyp ERR! stack     at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16 )                                                                                                                                        gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:2 71:16)                                                                                                                                   gyp ERR! stack     at exithandler (child_process.js:310:5)                                                                               gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:322:5)                                                                 gyp ERR! stack     at ChildProcess.emit (events.js:321:20)                                                                               gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)                                             gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)                                                                       gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)                                                  gyp ERR! System Windows_NT 10.0.18363                                                                                                    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node- gyp.js" "rebuild"                                                                                                                        gyp ERR! cwd C:\dev\joomla4\node_modules\watchpack\node_modules\fsevents                                                                 gyp ERR! node -v v13.8.0                                                                                                                 gyp ERR! node-gyp -v v5.0.5                                                                                                              gyp ERR! not ok

System information (as much as possible)

  • NodeJS 13.8.0
  • NPM 6.13.6
avatar C-Lodder C-Lodder - open - 29 Feb 2020
avatar joomla-cms-bot joomla-cms-bot - change - 29 Feb 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Feb 2020
avatar brianteeman
brianteeman - comment - 29 Feb 2020

I dont understand the difference between npm i and npm ci
npm i works perfectly
npm ci I can confirm your results

node 12.3.1
npm 6.13.6

avatar brianteeman
brianteeman - comment - 29 Feb 2020

FWIW fsevents wont install for you because you are on windows

avatar C-Lodder
C-Lodder - comment - 29 Feb 2020

FS should be removed as a dependency as it's native to NodeJS

avatar Bakual
Bakual - comment - 29 Feb 2020

Afaik, npm ci does delete the existing packages prior to install.
Also npm ci goes strictly by the package-lock.json and will not write anything into the file. If the package-lock isn't valid if compared to the package.json, it will fail.

So npm ci is preferred in our case and if it fails we have messed up something and that has to be fixed.

avatar wilsonge
wilsonge - comment - 1 Mar 2020

FS should be removed as a dependency as it's native to NodeJS

webpack requires watchpack which requires chokidar which requires fsevents. good luck fixing that unless we wanna use the 5.0 beta versions of webpack which will drop it... but then we're on a beta version of webpack which obviously isn't going to happen. So we're not effectively going to remove it for a while.

Looks like FSEvents needs python somewhere to compile - can't find it and goes kaboom. My guess is if you installed the python windows binaries on your machine you wouldn't get the error (not saying that's an acceptable solution - it's clearly not). But just trying to figure out what's going on here.

avatar N6REJ
N6REJ - comment - 12 Mar 2020

Looks like fsevents/fsevents#301 is relevant
and
npm/cli#558

avatar brianteeman
brianteeman - comment - 12 Apr 2020

npm i - works perfectly
npm ci - errors on windos

avatar wilsonge
wilsonge - comment - 12 Apr 2020

The stuff mentioned by @N6REJ looks like it totally is the issue. The issue is how to fix it. @Bakual tried locking the dependency down like suggested here fsevents/fsevents#301 (comment) but apparently it didn't work. It would be good if someone else could confirm that for me.

Apparently this will get fixed by Node 7. In the meantime I think we're going to have to live with npm i on windows and accept there's going to be slightly different dependencies at times.

avatar Bakual
Bakual - comment - 12 Apr 2020

I get an error with npm i as well, some syntax error

E:\xampp\htdocs\joomla4\node_modules\fs-extra\lib\mkdirs\make-dir.js:86
      } catch {
              ^

SyntaxError: Unexpected token {

I have no clue if that's related or not.

avatar jwaisner jwaisner - change - 15 Apr 2020
Status New Confirmed
Build staging 4.0-dev
avatar wilsonge
wilsonge - comment - 29 May 2020

This should be fixed in #29253 as fsevents made an update for windows machines on their deprecated branch ?

avatar wilsonge wilsonge - close - 29 May 2020
avatar wilsonge wilsonge - change - 29 May 2020
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2020-05-29 21:45:32
Closed_By wilsonge

Add a Comment

Login with GitHub to post a comment