wisdom-framework / wisdom

A modular and dynamic web framework
http://wisdom-framework.org
Apache License 2.0
88 stars 42 forks source link

node modules path is not right when forcing npm prefix #534

Closed nicolas-rempulski closed 8 years ago

nicolas-rempulski commented 8 years ago

I have a .npmrc file to set up my globals node modules location :

prefix=/home/nrempu01/.npm-packages registry=http://registry.npmjs.org

In Wisdom, while node installation complete in expected path :

[INFO] Installing node version v4.1.2 [INFO] Creating temporary directory /home/nrempu01/.wisdom/node/v4.1.2/node_tmp [INFO] Downloading Node.js from https://nodejs.org/dist/v4.1.2/node-v4.1.2-linux-x64.tar.gz to /home/nrempu01/.wisdom/node/v4.1.2/node_tmp/node.tar.gz [INFO] No proxies configured [INFO] No proxy was configured, downloading directly [INFO] Extracting Node.js files in node_tmp [INFO] Unpacking /home/nrempu01/.wisdom/node/v4.1.2/node_tmp/node.tar.gz into /home/nrempu01/.wisdom/node/v4.1.2/node_tmp [INFO] Moving node binary to /home/nrempu01/.wisdom/node/v4.1.2/node/node [INFO] Deleting temporary directory /home/nrempu01/.wisdom/node/v4.1.2/node_tmp [INFO] Installed node locally. [INFO] Installing npm version 2.13.0 [INFO] Downloading NPM from http://registry.npmjs.org/npm/-/npm-2.13.0.tgz to /home/nrempu01/.wisdom/node/v4.1.2/npm.tar.gz [INFO] No proxies configured [INFO] No proxy was configured, downloading directly [INFO] Extracting NPM files in node/ [INFO] Unpacking /home/nrempu01/.wisdom/node/v4.1.2/npm.tar.gz into /home/nrempu01/.wisdom/node/v4.1.2/node/node_modules [INFO] Installed NPM locally. [INFO] Found proxies: [] [INFO] Running 'npm config set registry http://registry.npmjs.org --color=false' in null

Global modules installation use the prefix specified in .npmrc :

[INFO] Running 'npm install -g coffee-script@1.10.0 --color=false' in null [INFO] /home/nrempu01/.npm-packages/bin/coffee -> /home/nrempu01/.npm-packages/lib/node_modules/coffee-script/bin/coffee [INFO] /home/nrempu01/.npm-packages/bin/cake -> /home/nrempu01/.npm-packages/lib/node_modules/coffee-script/bin/cake [INFO] coffee-script@1.10.0 /home/nrempu01/.npm-packages/lib/node_modules/coffee-script

This cause npm module dependants Wisdom's goal to fail, because Wisdom is looking for them .wisdom/[...]

[INFO] Running 'npm install -g coffee-script@1.10.0 --color=false' in null [INFO] /home/nrempu01/.npm-packages/bin/coffee -> /home/nrempu01/.npm-packages/lib/node_modules/coffee-script/bin/coffee [INFO] /home/nrempu01/.npm-packages/bin/cake -> /home/nrempu01/.npm-packages/lib/node_modules/coffee-script/bin/cake [INFO] coffee-script@1.10.0 /home/nrempu01/.npm-packages/lib/node_modules/coffee-script [INFO] Compiling CoffeeScript files from /home/nrempu01/Dev/Codebase/Playground/wisdom-jdbc/openjpa-sample/src/main/resources/assets [...] [ERROR] Failed to execute goal org.wisdom-framework:wisdom-maven-plugin:0.10.0-SNAPSHOT:compile-coffeescript (default-compile-coffeescript) on project openjpa-sample: Execution default-compile-coffeescript of goal org.wisdom-framework:wisdom-maven-plugin:0.10.0-SNAPSHOT:compile-coffeescript failed: The npm module coffee-script is not installed -> [Help 1]

cescoffier commented 8 years ago

Fixed in master.

nicolas-rempulski commented 8 years ago

Tested on openjpa-sample (same as OP) and it works fine !

[INFO] Found proxies: [] [INFO] Node v4.1.2 is already installed. [INFO] Found NPM version 2.13.0 [INFO] Found proxies: [] [INFO] Running 'npm install coffee-script@1.10.0 --color=false' in /home/nrempu01/.wisdom/node/v4.1.2 [INFO] coffee-script@1.10.0 node_modules/coffee-script [INFO] Compiling CoffeeScript files from /home/nrempu01/Dev/Codebase/Playground/wisdom-jdbc/openjpa-sample/src/main/resources/assets [INFO] Executing [/home/nrempu01/.wisdom/node/v4.1.2/node/node, /home/nrempu01/.wisdom/node/v4.1.2/node_modules/coffee-script/./bin/coffee, --compile, --map, --output, /home/nrempu01/Dev/Codebase/Playground/wisdom-jdbc/openjpa-sample/target/classes/assets, /home/nrempu01/Dev/Codebase/Playground/wisdom-jdbc/openjpa-sample/src/main/resources/assets] from /home/nrempu01/Dev/Codebase/Playground/wisdom-jdbc/openjpa-sample

Thx ! :+1: