My Jenkins is running on CentOS 6 with node.js 0.10.15 and bower 1.0.3.
I have a shell task which executes the following:
npm install
bower install
grunt clean package
The bower installation fails when building:
+ bower install
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Object.<anonymous> (/usr/lib/node_modules/bower/node_modules/
update-notifier/node_modules/configstore/configstore.js:9:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
Build step 'Execute shell' marked build as failure
When I'm executing bower install in a terminal while logged in as the Jenkins user, it works. The other mentioned commands work as expected (npm, grunt).
Any ideas?
It appears that your execution environment has neither $XDG_CONFIG_HOME nor $HOME set as environment variables.
You can work around this by manually setting it, for example, to the current workspace:
export XDG_CONFIG_HOME="$WORKSPACE/.config"
...
bower install
Related
We are using grunt to build our angularjs application.
GruntFile.js contains war:target task to create war file.
Its working locally but not while running jenkins build.
We have 2 different jobs running with following npm and node version.
In 1 job war is getting created and in other war creation failing.
npm info using npm#5.6.0
npm info using node#v8.11.4
Running "war:target" (war) task
Warning: Unexpected token *
Use --force to continue.
Aborted due to warnings.
Stack trace for reference
Warning: Unexpected token * Use --force to continue.
/tmp/workspace/dept-dev-my-angular-app-17486/dept-dev-my-angular-app-17486-my-angular-app-ui.feature-develop/node_modules/readdir-glob/index.js:62
async function* exploreWalkAsync(dir, path, followSyslinks, useStat, shouldSkip, strict) {
^
SyntaxError: Unexpected token *
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/tmp/workspace/dept-dev-my-angular-app-17486/dept-dev-my-angular-app-17486-my-angular-app-ui.feature-develop/node_modules/archiver/lib/core.js:9:12)
Could you please advise on this ?
I tried to configure automated code coverage in CI/CD in one of my branches in GitLab, and the pipeline passed perfectly within the branch, but when the admin merged the changes into the main branch, the pipeline failed due to a missing binding.
I used gitlab-ci.yml to configure my jobs in. I didn't have any experience working with pipelines, so this was pretty much a trial and error task for me.
Finally I got the configuration that was working for me that didn't break anything and produced the coverage as required. However, since it was showing a no space error prior to a successful build, I had to force clear the cache to get the jobs to run properly. Within my branch, the pipeline passed without any errors and I double checked by re-running it several times. But once the admin merged the branch it suddenly started producing the following error:
ERROR in Module build failed: Error: Missing binding /builds/internal/employee_portal/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 11.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (/builds/internal/employee_portal/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/builds/internal/employee_portal/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.sassLoader (/builds/internal/employee_portal/node_modules/sass-loader/lib/loader.js:46:72)
ERROR in ./src/styles.scss
Module build failed: ModuleBuildError: Module build failed: Error: Missing binding /builds/internal/employee_portal/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 11.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (/builds/internal/employee_portal/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/builds/internal/employee_portal/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.sassLoader (/builds/internal/employee_portal/node_modules/sass-loader/lib/loader.js:46:72)
at runLoaders (/builds/internal/employee_portal/node_modules/webpack/lib/NormalModule.js:244:20)
at /builds/internal/employee_portal/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /builds/internal/employee_portal/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at runSyncOrAsync (/builds/internal/employee_portal/node_modules/loader-runner/lib/LoaderRunner.js:143:3)
at iterateNormalLoaders (/builds/internal/employee_portal/node_modules/loader-runner/lib/LoaderRunner.js:229:2)
at Array.<anonymous> (/builds/internal/employee_portal/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
at Storage.finished (/builds/internal/employee_portal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
at provider (/builds/internal/employee_portal/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
at /builds/internal/employee_portal/node_modules/graceful-fs/graceful-fs.js:90:16
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
ERROR: Job failed: exit code 1
side note: The branch I was working on had been checked out from the main branch, no changes from other branches had been included into this one.
I wanted to know:
what part of my code caused this error (i suspect force clearing the cache, but just a hunch)
why this error did not appear in the pipeline of the branch I was working in?
why is the runner giving an error when it has bindings for an updated version of Node? Shouldn't it be backward compatible?
I've looked at this link, but I'm curious as to why this error never occurred before merge and even if it did, why is it giving me an error because I have an updated version installed.
Here is my gitlab-ci.yml file:
image: trion/ng-cli-karma
cache:
paths:
- node_modules/
build:
stage: build
script:
- npm cache clear --force
- npm i #angular/cli
- npm install
- npm run generate-docs
- ./node_modules/.bin/ng build --prod --base-href . --output-path www/
artifacts:
paths:
- www/
- documentation/
variables:
DOCKER_DRIVER: overlay
test:
stage: test
script:
- ./node_modules/.bin/ng test --code-coverage=true
artifacts:
paths:
- coverage/
coverage: '/(\d*.?\d+)%/'
pages:
stage: deploy
dependencies:
- build
- test
script:
- ls
- mv documentation www/
- mv coverage/ www/
- mv www/ public
- ls public/
artifacts:
paths:
- public
expire_in: 30 days
I had the same problem and npm rebuild node-sass command didn't work for me. The reason was the npm cache. If you clear the cache, issue would be resolved.
Steps followed:
Remove node modules rm -rf node_modules/
Remove cache npm cache clean --force
Verify cache removed npm cache verify
npm install
Trying to generate a clean jhipster project on a linux mint env
yo jhipster
gives
/home/poc/node_modules/generator-jhipster/generators/app/index.js:15
constructor: function (...args) { // eslint-disable-line object-shorthand
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.defineProperty.get [as jhipster:app] (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:40:23)
at Store.get (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:64:35)
at Environment.get (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:262:16)
My
yo doctor
gives
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
I'm running these versions
nodejs - v4.2.6
npm - 3.5.2
yo - 1.8.5
Any thoughts?
Your NodeJS is too old, JHipster 4 requires 6.9.5, please upgrade node.
I'm installing laravel elixir on my latest homestead machine , working on laravel 5.3, i followed the exact documentation to install laravel elixir, but it didn't worked , it's throwing error regarding sass file. here is snapshot
How do i solve this issue.
test version is ->
```
[19:33:15] Using gulpfile ~/sites/dev.friendsforever/server/gulpfile.js
[19:33:15] Starting 'all'...
[19:33:15] Starting 'sass'...
[19:33:16] 'sass' errored after 169 ms
[19:33:16] Error: ENOENT: no such file or directory, scandir '/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/vendor'
at Error (native)
at Object.fs.readdirSync (fs.js:856:18)
at Object.getInstalledBinaries (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/extensions.js:119:13)
at foundBinariesList (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:45:5)
at Object.<anonymous> (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/index.js:15:28)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
[19:33:16] 'all' errored after 179 ms
[19:33:16] Error in plugin 'run-sequence(sass)'
Message:
ENOENT: no such file or directory, scandir '/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/vendor'
Details:
errno: -2
code: ENOENT
syscall: scandir
path: /home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/vendor
Stack:
Error: ENOENT: no such file or directory, scandir '/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/vendor'
at Error (native)
at Object.fs.readdirSync (fs.js:856:18)
at Object.getInstalledBinaries (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/extensions.js:119:13)
at foundBinariesList (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/errors.js:45:5)
at Object.<anonymous> (/home/vagrant/sites/dev.friendsforever/server/node_modules/node-sass/lib/index.js:15:28)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
```
image version is ->
the problem is the incompatibility between OS and node js, so the solution is just run the command npm rebuild node-sass.
Just run npm rebuild node-sass from within your Host computer. If you have node installed on your computer, it will rebuild node-sass, detect whatever environment your Host computer is, and do something specific to that node-sass build.
Then run gulp command, hope it will work.
If you haven't figured it out by now, you can run
npm install node-sass --no-bin-links
from within the virtual machine and then gulp should work.
If you are getting "Error: ENOENT: no such file or directory..." error run this command. It worked for me.
npm rebuild node-sass
Reference: https://laracasts.com/discuss/channels/elixir/laravel-53-gulp-error-cannot-find-module-laravel-elixir-vue-2
I have got Yeoman installed and when I run the yo command I get this:
Error: EACCES, permission denied '/Users/Richard_Home/.config/configstore/insight-yo.yml'
You don't have access to this file.
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at Object.create.all.set (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:56:8)
at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:19:11)
at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:23:34)
at Object.<anonymous> (/usr/local/lib/node_modules/yo/cli.js:23:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
[03:35:36] ~ $
I have tried adding this to my $path:
export PATH=/usr/local/bin/npm:$PATH
as that is where npm is.
When I do sudo yo install generator-webapp
I get this response:
A quick solution would be to change where npm stores global packages by
putting ~/npm/bin in your PATH and running:
npm config set prefix ~/npm
I have run npm config set prefix ~/npm
I still get the same error access denied.
I just want to run yo I have it installed on an iMac and it worked straight away. I am on a macBook.