Travis build fails due to badly outdated NPM - travis-ci

I'm looking to use Travis CI. I am erroring out due to failures during npm install. I noticed it can't find file versions marked with ^. This character was added recently. Looking at the build output I noticed:
$ npm --version
1.2.30
My development machine runs npm 2.5.1. I did not see any way to upgrade npm in the Travis CI Settings. I manually changed my package.json to use ~ and that seems to have helped as I got more output:
"devDependencies": {
"jasmine-core": "~2.2.0",
"karma": "~0.12.31",
"karma-chrome-launcher": "~0.1.7",
"karma-cli": "0.0.4",
"karma-jasmine": "~0.3.5",
"karma-requirejs": "~0.2.2",
"requirejs": "~2.1.16"
}
However, I still get errors and these errors also display file version issues and use ^.
How can I get past this?

Add this to your .travis.yml:
before_install:
- "npm install -g npm#'>=2.5.0'"
That resolved my build failure.

Related

#types/express-serve-static-core/index.d.ts causing build errors

Started encountering this issue after pushing changes which has nothing to do with the node_modules or the deployment pipeline.
This issue is also seen when trying to rerun an already successful deployment in bitbucket.
I even tried updating the some of the packages to the latest version, but it still throws the same error.
But locally in my pc I have no issue with npm run build.
When the bitbucket pipeline is run.
The docker first installs node_modules using the npm install cmd.
After this while running npm run build the pipeline is failing with the error shown in the image above.
So I suspect it is the packages in the node_modules that are newly getting downloaded, because locally I have no problem with the build cmd.
Could anyone help me out, whether it is the incompatibility between the npm packages or the pipeline itself, Or if there might be any other error.
Thank you
Thanks to #Nitheesram Rajes I was able to fix this issue by updating typescript package using the command
npm install --save-dev typescript#latest

Cannot find module 'babel-eslint' (both standard and babel-eslint already installed locally)

What version of standard?
12.0.1
What operating system, Node.js, and npm version?
Windows 10,
Node v10.15.1,
NPM v.6.8.0
What did you expect to happen?
I install both standard and babel-eslint on devDependencies
(locally).
I run standard --parser babel-eslint
I get the standard use babel-eslint parser to recognize babel code style and not stating
it as style error
What actually happened?
I install both standard and babel-eslint on devDependencies (locally).
I run standard --parser babel-eslint
I get error: Cannot find module 'babel-eslint'
I read from previous issues 85 1167, it should be fixed when they are installed on the same level. But it does not happen on mine.
I have tried to put config below on package.json:
"standard": {
"parser": "babel-eslint"
}
But it does not resolve the issue.
Hi this is an old question but for who passes here in the future, those answers didn't work for me, but this one did:
npm install babel-eslint --save-dev
Try
$yarn add standard babel-eslint
I solved this by doing:
npm install -g babel-eslint

Command `bundle` unrecognized. Did you mean to run this inside a react-native project?

I am currently upgrading to the most recent version of react from 0.11.0 branch.
I have upgraded successfully through each step with minimal issues but when I got to 0.14.0 I hit some issues with:
node_modules/react-native/packager/react-native-xcode.sh
No matter what I do all my machines seem to get this same error.
Command `bundle` unrecognized. Did you mean to run this inside a react-native project?
I also run this same command that script runs from my terminal in the same location and it works fine, I have also set the path as well and before the script runs no mas, set path inside the script still nothing.
I am hoping someone else has saw this and has found a solution or is there a work around so we dont need this script.
I started this project with react-native ~0.6.0 maybe even a little earlier.
I have even removed nvm to combat this issue and using single install of node which is on PATH in both conditions.
Thanks!
Have you installed the latest version of react-native-cli globally?
npm uninstall -g react-native-cli
npm install -g react-native-cli
I personally preferred to install it as a dev dependency.
yarn add -D react-native-cli

Using "npm install" to install jquery-ui

I see from here https://github.com/jquery/jquery-ui that jquery-ui's latest release is 1.11.4. However, when I use "npm install jquery-ui", it's only 1.10.3. I checked this version in node_modules/jquery-ui/jquery-ui.js.
Is there any way for me to install the latest version?
jQuery-ui specifically needs to be build after installation. To avoid this, use npm install jquery-ui-dist
T J gave the right answer, but it is a bit short / too generic.
The GitHub project is at https://github.com/jquery/jquery-ui/
So the real command would be npm install github:jquery/jquery-ui (you can even skip github: as npm defaults to it).
But this would bring you the latest, unstable version (around 1.12 at time of writing), and it didn't even work when I tried.
So it is better to fetch a tagged version:
npm install github:jquery/jquery-ui#1.11.4
Generic note: AFAIK, if the project hasn't a package.json file, this kind of install can still fail.
Here is the current latest version (1.11.4), same package that bower is using, including all themes.
npm install github:components/jqueryui#1.11.4
You can install it like
npm install github:mygithubuser/myproject
as mentioned in the install documentation

How to use modified node module using github branch?

I'm using the rc-slider component in my application and had to
add one feature to meet my needs.
I forked the main repository and pushed my changes to this branch.
In the application, I changed the package.json as below and ran the npm install again:
"rc-slider": "Rodrigora/slider#add-label"
Nothing changed. Seems that npm doesn't update the dependencies.
So, I removed the node_modules and rails cache folder and ran the install command again:
rm -rf node_modules/
rake tmp:cache:clear
npm install
Now, I have this error:
events.js:142
throw er; // Unhandled 'error' event
^
Error: Cannot find module 'rc-slider' from '/Users/rodrigora/project/app/assets/javascripts'
NPM can't find the rc-slider when I using the modified branch.
NPM does not update the dependencies only changing the package.json file?
Should I run some build command to install my branch code?
In npm docs:
"dependencies": {
"rc-slider": "git://github.com/Rodrigora/slider.git#add-label"
}
Also you can use
npm install git://github.com/Rodrigora/slider.git#add-label --save
The above command will add that dependency in your package.json.
Edit:
I miss understood your question. I tried the below fix in the repo that you mentioned and it worked. (you should also have the dependency setup like above)
It is a react project. It is compiled and published to NPM.
So, if you want to install it directly from your github fork, you should make some changes to package.json
Before making changes in package.json install rc-tools globaly:
sudo npm install rc-tools -g
Change the files that should be included:
"files": [
"index.js",
"assets",
"src"
]
and add postinstall script in scripts:
"postinstall": "rc-tools run compile"
Then try installing from github after making these changes in that branch.
You can use git repositories as NPM packages:
"rc-slider": "git://github.com/Rodrigora/slider#add-label"

Resources