Could not find org.webjars.npm:js-tokens:[3.0.0,4),[4.0.0,5)


#1

Enonic version: YourEnonicVersion
OS: YourOS

Trying to run the ‘./gradlew build’ command on the coreui starter-pack. Get a build failure then.

  • What went wrong:
    A problem occurred configuring root project ‘coreui’.

Failed to notify project evaluation listener.
Could not resolve all dependencies for configuration ‘:webjar’.
Could not find org.webjars.npm:js-tokens:[3.0.0,4),[4.0.0,5).

Some one know how I can resolve this issue?

Thx :slight_smile:


#2

Hi,

There seems to be a broken package or something when using react with webjar.
Add the following lines to the bottom of you’re build.gradle file to fix the build problem.

configurations.each {
    c -> c.resolutionStrategy.dependencySubstitution {
        all { DependencySubstitution dependency ->
            if (dependency.requested.group == 'org.webjars.npm') {
                dependency.useTarget 'org.webjars.npm:js-tokens:3.0.2'
            }
        }
    }
}

//Runar


#3

Hi, that seemed to fix the original problem, but after implementing the fix and running a New build, another error occured.

:nodeSetup UP-TO-DATE
:npmSetup SKIPPED
:npmInstall

[email protected] install C:\Users\J154200\Documents\xp-source\coreui\node_modules\babel-changed\node_modules\pty.js
node-gyp rebuild

C:\Users\J154200\Documents\xp-source\coreui\node_modules\babel-changed\node_modules\pty.js>if not defined npm_config_node_gyp (node “C:\Users\J154200\Documents\xp-source\coreui.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node “” rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Users\J154200\Documents\xp-source\coreui.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Users\J154200\Documents\xp-source\coreui.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Users\J154200\Documents\xp-source\coreui.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command “C:\Users\J154200\Documents\xp-source\coreui\.gradle\nodejs\node-v6.9.4-win-x64\node.exe” “C:\Users\J154200\Documents\xp-source\coreui\.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
gyp ERR! cwd C:\Users\J154200\Documents\xp-source\coreui\node_modules\babel-changed\node_modules\pty.js
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
[email protected] C:\Users\J154200\Documents\xp-source\coreui
`-- UNMET PEER DEPENDENCY [email protected]

                                                                                                                   npm                                                                                                                      WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN [email protected] requires a peer of [email protected]^2.0.0 || ^3.0.0 || ^4.0.0 but none was installed.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! Windows_NT 10.0.17134
npm ERR! argv “C:\Users\J154200\Documents\xp-source\coreui\.gradle\nodejs\node-v6.9.4-win-x64\node.exe” “C:\Users\J154200\Documents\xp-source\coreui\.gradle\nodejs\node-v6.9.4-win-x64\node_modules\npm\bin\npm-cli.js” “install”
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script ‘node-gyp rebuild’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pty.js
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\J154200\Documents\xp-source\coreui\npm-debug.log
npm ERR! code 1
:npmInstall FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:npmInstall’.

Process ‘command ‘C:\Users\J154200\Documents\xp-source\coreui.gradle\nodejs\node-v6.9.4-win-x64\npm.cmd’’ finished with non-zero exit value 1

Not sure how to continue here :slight_smile:


#4

It says it can’t find Python to rebuild some binary for your environment. You either don’t have Python installed or you don’t have an environment variable specifying where to find Python.

If you have Python installed, you can set the path to Python in the Windows Control Panel. If you don’t have Python installed you have a lot of options.