I have manjaro linux and I installed nodejs and npm from official repositories
node version: v6.2.1
npm version: 3.9.5
gulp.task('inject', ['scripts', 'styles'], function () {
var injectStyles = gulp.src([
path.join(conf.paths.tmp, '/serve/app/**/*.css'),
path.join('!' + conf.paths.tmp, '/serve/app/vendor.css')
], { read: false });
var injectScripts = gulp.src([
path.join(conf.paths.src, '/app/**/*.module.js'),
path.join(conf.paths.src, '/app/**/*.js'),
path.join('!' + conf.paths.src, '/app/**/*.spec.js'),
path.join('!' + conf.paths.src, '/app/**/*.mock.js'),
])
.pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort'));
var injectOptions = {
ignorePath: [conf.paths.src, path.join(conf.paths.tmp, '/serve')],
addRootSlash: false
};
return gulp.src(path.join(conf.paths.src, '/*.html'))
.pipe($.inject(injectStyles, injectOptions))
.pipe($.inject(injectScripts, injectOptions))
.pipe(wiredep(_.extend({}, conf.wiredep)))
.pipe(gulp.dest(path.join(conf.paths.tmp, '/serve')));
});
When I run:
$ gulp serve
It display me:
[21:36:37] Using gulpfile /home/jics/Documents/Proyect/gulpfile.js
[21:36:37] Starting 'config'...
[21:36:37] Starting 'styles'...
[21:36:37] Finished 'config' after 236 ms
[21:36:37] Starting 'scripts'...
[21:36:37] gulp-inject 30 files into index.scss.
[21:36:39] Finished 'styles' after 2.36 s
[21:36:40] all files 211.97 kB
[21:36:40] Finished 'scripts' after 2.84 s
[21:36:40] Starting 'inject'...
[21:36:40] gulp-inject 1 files into index.html.
Segmentation fault
My coredumctl display me:
PID: 29909 (gulp)
UID: 1000 (jics)
GID: 1000 (jics)
Signal: 11 (SEGV)
Timestamp: lun 2016-06-13 18:03:49 CLT (3h 37min ago)
Command Line: gulp
Executable: /usr/bin/node
Control Group: /user.slice/user-1000.slice/session-c2.scope
Unit: session-c2.scope
Slice: user-1000.slice
Session: c2
Owner UID: 1000 (jics)
Boot ID: 857cb1e6f9134beb91d172fc85f05f36
Machine ID: 50f47fe8f80b4f92829b61933e8b309e
Hostname: jics-pc
Coredump: /var/lib/systemd/coredump/core.gulp.1000.857cb1e6f9134beb91d172fc85f05f36.29909.1465
Message: Process 29909 (gulp) of user 1000 dumped core.
Stack trace of thread 29909:
#0 0x00002080c7ca188c n/a (n/a)
The only why I can run gulp serve with success is deleting de follow line from de configuration file .pipe($.inject(injectScripts, injectOptions))
Well I did do it with n
$ sudo npm install -g n
$ sudo n stable
install : node-v6.2.1
mkdir : /usr/local/n/versions/node/6.2.1
fetch : https://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-x64.tar.gz
######################################################################## 100,0%
installed : v6.2.1
Finally I do $ gulp serve and run perfectly
Related
We launch our Electron-based app like so:
test.beforeAll(async() => {
electronApp = await _electron.launch({
args: [
path.join(__dirname, '../'),
'--disable-gpu',
'--whitelisted-ips=',
'--disable-dev-shm-usage',
]
});
...
It used to work. Now the tests fail with this error message:
electron.launch: Timeout 30000ms exceeded.
61 | createDefaultSettings();
62 |
> 63 | electronApp = await _electron.launch({
| ^
You can see the tests at https://github.com/rancher-sandbox/rancher-desktop . To reproduce:
Set up:
git clone https://github.com/rancher-sandbox/rancher-desktop.git
npm i
To reproduce:
npm run test:e2e
This might be related to the node issue on Monterey 12.3.1 that it is already running on the default port 5000.
Try disabling "Airplay receiver" like this post, it worked for me.
"System Preference" -> "Sharing" -> "Airplay receiver"
Why nodeJS is not working on macOS Monterey?
After running ionic serve facing error: Cannot find type definition file for 'node'. I have reinstall ionic, cordova and node.js but still faceing this error
C:\Users\ali\Documents\TransporterApp>ionic serve
[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to
cancel
[21:24:00] watch started ...
[21:24:00] build dev started ...
[21:24:00] clean started ...
[21:24:00] clean finished in 3 ms
[21:24:00] copy started ...
[21:24:00] transpile started ...
[21:24:07] typescript: ...ts/TransporterApp/node_modules/#angular/tsc-wrapped/src/vinyl_file.d.ts, line: 1
Cannot find type definition file for 'node'.
L1: export interface VinylFile extends Object {
L2: path: string;
[21:24:07] typescript: ...ts/TransporterApp/node_modules/#angular/tsc-wrapped/src/vinyl_file.d.ts, line: 11
Cannot find name 'Buffer'.
[21:24:07] typescript: ...D2D-Transporter/node_modules/#ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 2
Namespace ''*'' has no exported member 'Options'.
L1: import * as cleanCss from 'clean-css';
L2: export declare function getCleanCssInstance(options: cleanCss.Options): cleanCss;
L3: export interface CleanCssConfig {
[21:24:07] typescript: ...D2D-Transporter/node_modules/#ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 2
Cannot find name 'cleanCss'.
L1: import * as cleanCss from 'clean-css';
L2: export declare function getCleanCssInstance(options: cleanCss.Options): cleanCss;
L3: export interface CleanCssConfig {
[21:24:07] typescript: ...D2D-Transporter/node_modules/#ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 6
Namespace ''*'' has no exported member 'Options'.
L5: destFileName: string;
L6: options?: cleanCss.Options;
[21:24:07] typescript: ...2D-Transporter/node_modules/#ionic/app-scripts/dist/util/virtual-file-utils.d.ts, line: 1
Cannot find type definition file for 'node'.
L1: import { Stats } from 'fs';
L2: export declare class VirtualStats implements Stats {
[21:24:07] typescript: ...2D-Transporter/node_modules/#ionic/app-scripts/dist/util/virtual-file-utils.d.ts, line: 3
Cannot find name 'Stats'.
L2: export declare class VirtualStats implements Stats {
L3: protected _path: string;
L4: protected _ctime: Date;
[21:24:07] dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
[21:24:07] copy finished in 6.75 s
[21:24:07] watch ready in 6.97 s
System info are:
cli packages:
#ionic/cli-plugin-ionic-angular : 1.4.0 (C:\Users\ali\Documents\TransporterApp\node_modules\#ionic\cli-plugin-ionic-angular)
#ionic/cli-utils : 1.6.0 (C:\Users\ali\Documents\TransporterApp\node_modules\ionic\node_modules\#ionic\cli-utils)
ionic (Ionic CLI) : 3.6.0 (C:\Users\ali\Documents\TransporterApp\node_modules\ionic)
global packages:
Cordova CLI : 7.0.1
local packages:
#ionic/app-scripts : 1.3.7
#ionic/cli-plugin-cordova : 1.4.1
Cordova Platforms : none
Ionic Framework : ionic-angular 3.2.1
System:
Android SDK Tools : 25.2.5
Node : v6.11.1
OS : Windows 7
npm : 3.10.10
I encountered to this issue before:
npm install #types/node --save-dev
worked for me.
I am trying to install slack node library, but not able to do it successfully.
I installed this library successfully on laravel 5.4 using node js. And my gulpfile is upgraded from 5.3 to 5.4 and attached below.
npm install #slack/client --save (Installation is fine but gukp is causing issue)
But when i run gulp command on shell i am getting following error:-
After adding adding this line in app.js:-
var RtmClient = require('#slack/client').RtmClient;
gulpfile.js (manually eddited)
const elixir = require('laravel-elixir');
const path = require('path');
const debug = require('gulp-debug');
const moment = require('moment');// in my gulp file
require('laravel-elixir-webpack-official');
require('laravel-elixir-vue-2');
elixir(function(mix) {
// Elixir.webpack.config.module.loaders = [];
Elixir.webpack.mergeConfig({
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css'
}
]
}
});
mix.sass('app.scss')
.webpack('app.js')
.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap')
});
Error on Gulp Command
user1#console:/opt/lampp/htdocs/dev$ gulp
[15:40:27] Using gulpfile /opt/lampp/htdocs/dev/gulpfile.js
[15:40:27] Starting 'all'...
[15:40:27] Starting 'sass'...
[15:40:28] Finished 'sass' after 1.08 s
[15:40:28] Starting 'webpack'...
{ [Error: ./~/winston/package.json
Module parse failed: /opt/lampp/htdocs/dev/node_modules/winston/package.json Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
| {
| "_args": [
| [
| {
# ./~/winston/lib/winston.js 14:18-44
# ./~/#slack/client/lib/helpers.js
# ./~/#slack/client/lib/clients/client.js
# ./~/#slack/client/lib/clients/web/client.js
# ./~/#slack/client/index.js
# ./resources/assets/js/app.js./~/winston/lib/winston/common.js
Module not found: Error: Can't resolve 'fs' in '/opt/lampp/htdocs/dev/node_modules/winston/lib/winston'
resolve 'fs' in '/opt/lampp/htdocs/dev/node_modules/winston/lib/winston'
Parsed request is a module
using description file: /opt/lampp/htdocs/dev/node_modules/winston/package.json (relative path: ./lib/winston)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /opt/lampp/htdocs/dev/node_modules/winston/package.json (relative path: ./lib/winston)
resolve as module
/opt/lampp/htdocs/dev/node_modules/node_modules doesn't exist or is not a directory
Thanks in advance
I'm trying to create API documents through grunt-ngdocs.
The partials are created but the index.html doesn't have the correct links to it.
I have in my gruntfile.js:
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
unit: {
configFile: 'karma.conf.js'
}
},
uglify: {
options: {
// the banner is inserted at the top of the output
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'web/js/app.min.js': ['web/js/app.js']
}
}
},
ngdocs: {
options: {
dest: 'docs',
scripts: ['web/js/app.js'],
title: 'My Documentation'
},
api: {
src: ['web/**/*.js'],
title: 'API Documentation'
}
},
clean:['docs','testResult']
});
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-ngdocs');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('default', ['clean','uglify', 'ngdocs', 'karma']);
};
and my js file like this
/**
* #ngdoc overview
* #ngdoc directive
* #name myApp.maincontroller:controller
* #description
*
* # myApp
* The factoryName is my favorite service in the world.
*
*/
var myApp = angular.module('myApp',[]);
myApp.controller("MainController", function($scope) {
$scope.model = {
myValue: "Run you fools!"
};
});
/**
* #ngdoc function
* #name mySuperFunction
* #returns {int} The int representing a Firebase resource
*/
function mySuperFunction() {
var i = 5;
var j = 5;
i += j;
return i;
}
but when I run
grunt
in the command line, the result is this
C:\Users\Lino Simões\Documents\bitbucket\test>grunt -d --force
Running "clean:0" (clean) task
[D] Task source: C:\Users\Lino Simões\Documents\bitbucket\test\node_modules\grun
t-contrib-clean\tasks\clean.js
Cleaning docs...OK
Running "clean:1" (clean) task
[D] Task source: C:\Users\Lino Simões\Documents\bitbucket\test\node_modules\grun
t-contrib-clean\tasks\clean.js
Cleaning testResult...OK
Running "uglify:dist" (uglify) task
[D] Task source: C:\Users\Lino Simões\Documents\bitbucket\test\node_modules\grun
t-contrib-uglify\tasks\uglify.js
File web/js/app.min.js created: 796 B → 210 B
Running "ngdocs:api" (ngdocs) task
[D] Task source: C:\Users\Lino Simões\Documents\bitbucket\test\node_modules\grun
t-ngdocs\tasks\grunt-ngdocs.js
Generating Documentation...
DONE. Generated 2 pages in 256ms.
Running "karma:unit" (karma) task
[D] Task source: C:\Users\Lino Simões\Documents\bitbucket\test\node_modules\grun
t-karma\tasks\grunt-karma.js
INFO [karma]: Karma v0.12.17 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.7 (Windows 7)]: Connected on socket dFX-dKGVINA6PBjB5Gu9 wit
h id 91061839
PhantomJS 1.9.7 (Windows 7): Executed 8 of 8 SUCCESS (0.008 secs / 0.004 secs)
Done, without errors.
so, this generates 2 files, but when I go to the index.html under docs I have this:
but in my docs/partials/api/ I have the partials created by the ngdocs.
my project tree is like this:
Did you have angular.js and angular-animate.js in your web/js/app.js? Check it. And add to "options" html5Mode: false
for ng1.6 works for me:
ngdocs: {
all: ['app/**/*.js']
}
you will see the old version of angular 1.2.* in
cat docs/js/angular.min.js | grep v1
AngularJS v1.2.16
but it does not affect your source files.
also, dont forget run server
for generated folder docs:
e.g using python
pushd ./dist; python -m SimpleHTTPServer 9000; popd #v 2.*
pushd ./dist; python -m http.server 9000; popd #v 3.*
unfortunately, adding angular.js and angular-animate.js to scripts option doesn't work for me
I am trying to build a docker image containing my Vue.js project but it fails with below error when I try to upgrade from Node 9 to Node 10:
$ docker build -t frontend-image .
...
Step 10/10 : RUN npm run build
---> Running in a7b7f92e4615
> demo-vue#1.0.0 build /app
> node build/build.js
node[18]: ../src/node_file.cc:836:void node::fs::Stat(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) == (4)' failed.
1: 0x9d8da0 node::Abort() [node]
2: 0x9d8e27 [node]
3: 0x9e5652 [node]
4: 0xba3c19 [node]
5: 0xba5a07 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
6: 0x13726d9 [node]
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! demo-vue#1.0.0 build: `node build/build.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the demo-vue#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-10-23T19_00_49_014Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 134
Some details below...
Project layout:
frontend/
-> build/
-> config/
-> src/
-> static/
-> test/
-> build.sh
-> Dockerfile
-> package.json
frontend/Dockerfile:
FROM node:10
# Works with node 9
#FROM node:9
RUN apt install curl
# make the 'app' folder the current working directory
RUN mkdir /app
WORKDIR /app
# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
# install simple http server for serving static content and project dependencies
RUN npm install -g http-server
RUN npm install
EXPOSE 8080
# PROD build
# build app for production with minification
RUN npm run build
frontend/package.json (scripts part):
"scripts": {
...
"build-server": "webpack --config build/webpack.server.conf.js && node src/server.js",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"build": "node build/build.js && npm run build-server"
},
frontend/build/build.js:
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // if you are using ts-loader, setting this to true will make tyescript errors show up during build
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
frontend/build/check-versions.js
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
Looking at the above error message this part:
> node build/build.js
seems to be the cause of the error but the following text does not really provide me with much help to why node build/build.js fails.
Any ideas?