question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modules that run install scripts require node to be on the path. Helper scripts don't cover this.

See original GitHub issue

When installing node-sass (for example), the process executes node scripts/install.js and when node is not on the path this fails… or worse, node IS on the path but is somehow incompatible which causes the module to be installed in a broken state (which happened to me). I could make a pull request for the helper script, but it’s a single line change. I suggest this:

#!/bin/sh
PATH="$PWD/node/":$PATH
node "node/node_modules/npm/bin/npm-cli.js" "$@"

It puts the embedded node binary earlier on the path, which should give it precedence over a globally installed version (if any).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RobzInadEcommented, Apr 12, 2016

It works now, bumped the plugin version (decided to bump node to v4.4.2 and npm to 3.8.3 as well) and it works fine! Sorry for confusion! I’d have avoided this if you had changelogs 😉

Regards

0reactions
eirslettcommented, Apr 11, 2016

because it runs node install.js and node isn’t on the path

All the recent versions of this plugin are supposed to fix that; node and npm should be added to PATH whenever you run Maven.

Could you try to add phantomjs-prebuilt to this integration test: (basically upgrade the karma/phantomjs dependencies) and see if you can reproduce the problem there? https://github.com/eirslett/frontend-maven-plugin/tree/master/frontend-maven-plugin/src/it/example project

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requiring modules in Node.js: Everything you need to know
Node uses two core modules for managing module dependencies: The require module, which appears to be available on the global scope — no...
Read more >
Error with node-sass when running npm install - Stack Overflow
Run npm install, and don't worry, it will update npm-shrinkwrap.json with a bunch of content. Run gulp to start the project.
Read more >
scripts - npm Docs
Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state...
Read more >
CommonJS modules | Node.js v19.2.0 Documentation
CommonJS modules are the original way to package JavaScript code for Node.js. Node.js also supports the ECMAScript modules standard used by browsers and ......
Read more >
CloudFormation helper scripts reference - AWS Documentation
By default, helper scripts don't require credentials, so you don't need to use ... Running sudo yum install -y aws-cfn-bootstrap installs the helper...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found