Is the " npm run watch" property already in Laravel Vite? - laravel

Is the "watch" property already in vitejs?
I'm starting a new project using Laravel Framework 9.19.0 in which vite is auto-mounted.
I've added alpine.js for the front. I've tried to run
npm run watch
This is my package.json file
{
"private": true,
"scripts": {
"watch": "npm-watch", <-<=-----I've added this line------->
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^0.25",
"laravel-vite-plugin": "^0.2.1",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"vite": "^2.9.11"
},
"dependencies": {
"alpinejs": "^3.10.2"
}
}
and the following error occurred.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.17.6
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle #~prewatch: #
6 info lifecycle #~watch: #
7 verbose lifecycle #~watch: unsafe-perm in lifecycle true
8 verbose lifecycle #~watch: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Arotiana's\laravel9_portfolio\node_modules\.bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Inno Setup 5;C:\Program Files\nodejs\;C:\ProgramData\ComposerSetup\bin;C:\Program Files\Java\jdk-17.0.2\bin;C:\Program Files\Git\cmd;C:\flutter\bin;C:\Users\Arotiana's\AppData\Local\Microsoft\WindowsApps;C:\Users\Arotiana's\AppData\Roaming\npm;C:\Users\Arotiana's\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\PHP;C:\Users\Arotiana's\AppData\Roaming\Composer\vendor\bin;C:\Users\Arotiana's\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts;C:\Program Files\Java\jdk-17.0.2\bin;C:\windows\System32;C:\flutter\bin;
9 verbose lifecycle #~watch: CWD: C:\Users\Arotiana's\laravel9_portfolio
10 silly lifecycle #~watch: Args: [ '/d /s /c', 'npm-watch' ]
11 silly lifecycle #~watch: Returned: code: 1 signal: null
12 info lifecycle #~watch: Failed to exec watch script
13 verbose stack Error: # watch: `npm-watch`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid #
15 verbose cwd C:\Users\Arotiana's\laravel9_portfolio
16 verbose Windows_NT 10.0.19044
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
18 verbose node v14.17.6
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error # watch: `npm-watch`
22 error Exit status 1
23 error Failed at the # watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Can you help me??

You can replace your "scripts" by this:
"scripts": {
"dev": "vite",
"build": "vite build",
"watch": "vite build --watch"
},
And you can run npm run watch

Related

React-Native + Detox + Gitlab-ci + AWS EC2 / Cannot boot Android Emulator with the name

Describe the bug
My goal is to run unit test e2e detox for a mobile application in react-native from a Gitlab-ci on a AWS ec2 instance
AWS EC2: c5.xlarge 4 CPU / 8GB RAM
I just create an instance ec2 c5.xlarge on AWS and setup docker and gitlab-runner with docker executor (image: alpine) on it.
Here my .gitlab-ci.yml :
stages:
- unit-test
variables:
LC_ALL: 'en_US.UTF-8'
LANG: 'en_US.UTF-8'
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- node -v
- npm -v
- yarn -v
detox-android:
stage: unit-test
image: reactnativecommunity/react-native-android
before_script:
- echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p
- yarn install:module_only
script:
- mkdir -p /root/.android && touch /root/.android/repositories.cfg
#- $ANDROID_HOME/tools/bin/sdkmanager --list --verbose
- echo yes | $ANDROID_HOME/tools/bin/sdkmanager --channel=0 --verbose "system-images;android-25;google_apis;armeabi-v7a"
- echo no | $ANDROID_HOME/tools/bin/avdmanager --verbose create avd --force --name "Pixel_API_28_AOSP" --package "system-images;android-25;google_apis;armeabi-v7a" --sdcard 200M --device 11
- echo "Waiting emulator is ready..."
- emulator -avd "Pixel_API_28_AOSP" -debug-init -no-window -no-audio -gpu swiftshader_indirect -show-kernel &
- adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
- echo "Emulator is ready!"
- yarn detox-emu:build:android
- yarn detox-emu:test:android
tags:
- detox-android
only:
- ci/unit-test
here the script in my package.json for the ci:
{
scripts: {
"detox-emu:test:android": "npx detox test -c android.emu.release.ci --headless -l verbose",
"detox-emu:build:android": "npx detox build -c android.emu.release.ci"
}
}
here my .detoxrc.json
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"android.real": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.attached",
"device": {
"adbName": "60ac9404"
}
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"device": {
"avdName": "Pixel_API_28_AOSP"
}
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"device": {
"avdName": "Pixel_API_28_AOSP"
}
},
"android.emu.release.ci": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"device": {
"avdName": "Pixel_API_28_AOSP"
}
}
}
}
Here the things I tried many way to setup an android emulator on an EC2 but it's look working only with an emulator armeabi-v7a due to the cpu virtualisation. It's look like the latest emulator available for armeabi-v7a is system-images;android-25;google_apis;armeabi-v7a. It's look like I can only run an emulator with sdkversion 25 on EC2 instance then.
On my mobile app, I'm using mapbox for some features that require with detox minSdkversion 26. That I set on my build.gradle as well.
You can see full logs of my CI in attachement.
Log_CI.txt
I get an error because detox don't find my emulator for the name Pixel_API_28_AOSP. This error could be related to the minSdkVersion ? Or I miss something in my CI ?
Environment (please complete the following information):
Detox: 17.10.2
React Native: 0.63.2
Device: emulator system-images;android-25;google_apis;armeabi-v7a
OS: android
Thanks in advance for your help !

Can't build vue3+vite sample app in production mode on Windows

I cannot build a newly created vue3+vite app on Windows in production mode, while it works ok in development mode. Below are steps I executed to get an error :
npx create-vite-app test_vue3
cd test_vue3
npm install
npm run build
And the error is :
2020-12-01T21:42:14.689Z vite:config env mode: production
2020-12-01T21:42:14.705Z vite:config env: {}
[vite] Build errored out.
{ Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:5253:30)
at Module.error (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:9821:16)
at tryParse (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:9702:23)
at Module.setSource (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:10128:19)
at ModuleLoader.addModuleSource (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:18289:20)
code: 'PARSE_ERROR',
parserError:
{ SyntaxError: Unexpected token (1:0)
at Object.pp$4.raise (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:15543:13)
at Object.pp.unexpected (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:13235:8)
at Object.pp$3.parseExprAtom (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14942:10)
at Object.pp$3.parseExprSubscripts (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14745:19)
at Object.pp$3.parseMaybeUnary (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14722:17)
at Object.parseMaybeUnary (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:19145:29)
at Object.pp$3.parseExprOps (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14657:19)
at Object.pp$3.parseMaybeConditional (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14640:19)
at Object.pp$3.parseMaybeAssign (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14608:19)
at Object.pp$3.parseExpression (D:\test_vue3\node_modules\rollup\dist\shared\rollup.js:14574:19) pos: 0, loc: Position { line: 1, column: 0 }, raisedAt: 1 },
id: 'D:\\Proj_VUE\\test_vue3\\index.html',
pos: 0,
loc:
{ file: 'D:\\Proj_VUE\\test_vue3\\index.html',
line: 1,
column: 0 },
frame: '1: <!DOCTYPE html>\n ^\n2: <html lang="en">\n3: <head>',
watchFiles: [ 'D:\\Proj_VUE\\test_vue3\\index.html' ] }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test_vue3#0.0.0 build: `vite build --debug`
npm ERR! Exit status 1
Is there a way to workaround it somehow ? (I tried it on linux, and it works flawlessly)

test cases are failing in setupFilesAfterEnv mode while it is working fine in setupFiles mode in react with jest + enzyme

I am working on testing react components using jest and enzyme , earlier it was working properly but now when I am testing it is failing all test case when using this
"setupFilesAfterEnv": [
"./utils/jestUtils/setupTests.js"
],
and showing error like
● Test suite failed to run
TypeError: base intrinsic for Date.prototype.getUTCFullYear exists, but the property is not available.
1 | const Enzyme = require('enzyme');
> 2 | const EnzymeAdapter = require('enzyme-adapter-react-16');
| ^
3 |
4 | Enzyme.configure({ adapter: new EnzymeAdapter() });
5 |
at GetIntrinsic (node_modules/es-abstract/GetIntrinsic.js:209:12)
at callBoundIntrinsic (node_modules/es-abstract/helpers/callBound.js:10:18)
at Object.<anonymous> (node_modules/es-abstract/2015/YearFromTime.js:9:23)
at Object.<anonymous> (node_modules/es-abstract/2015/DayWithinYear.js:5:20)
at Object.<anonymous> (node_modules/es-abstract/2015/DateFromTime.js:7:21)
at Object.<anonymous> (node_modules/es-abstract/es2015.js:22:16)
at Object.<anonymous> (node_modules/es-abstract/es6.js:3:18)
at Object.<anonymous> (node_modules/array.prototype.find/index.js:4:10)
at Object.<anonymous> (node_modules/airbnb-prop-types/src/childrenOfType.js:1:1)
at Object.<anonymous> (node_modules/airbnb-prop-types/src/index.js:8:1)
at Object.<anonymous> (node_modules/airbnb-prop-types/index.js:1:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/createMountWrapper.jsx:3:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/Utils.js:3:1)
at Object.<anonymous> (node_modules/enzyme-adapter-utils/src/index.js:2:18)
at Object.<anonymous> (node_modules/enzyme-adapter-react-16/build/ReactSixteenAdapter.js:41:27)
at Object.<anonymous> (node_modules/enzyme-adapter-react-16/build/index.js:4:18)
at Object.<anonymous> (utils/jestUtils/setupTests.js:2:23)
at Array.forEach (<anonymous>)
Test Suites: 98 failed, 98 total
Tests: 0 total
Snapshots: 0 total
Time: 44.888s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ***#1.0.0 test: `jest --verbose --colors`
npm ERR! Exit status 1
but when I am changing it to
"setupFiles": [
"./utils/jestUtils/setupTests.js"
],
it is working fine and all the the test case are passed
Problem solved by deleting node_modules & package-lock.json file & reinstalling it by npm install

javax.net.ssl.SSLException after nativescript-messenger installation in nativescript

I installed project using vue-cli-template
https://github.com/nativescript-vue/vue-cli-template/tree/master
I installed nativescript-messenger and even without changes in code I saw error
Error: Command ./gradlew failed with exit code 1 Error output:
Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
We cannot present there full output of command:
cd dist && tns run android --device ZY223J2852 --log trace
but below is start and end of log trace.
Loading extensions.
Asserting extension nativescript-cloud is installed.
Extension nativescript-cloud is installed.
System information:
{ platform: 'linux',
shell: '/bin/bash',
os: 'Linux daniel-Inspiron-3543 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\n',
procArch: 'x64',
nodeVer: '8.11.1',
npmVer: '6.2.0',
nodeGypVer: null,
nativeScriptCliVersion: '4.1.2',
gitVer: '2.17.1',
dotNetVer: null,
javacVersion: '1.8.0_171',
adbVer: '1.0.40',
androidInstalled: true,
monoVer: null,
gradleVer: '4.9',
isAndroidSdkConfiguredCorrectly: true,
xcodeVer: undefined,
xcodeprojLocation: null,
itunesInstalled: false,
cocoaPodsVer: undefined,
isCocoaPodsWorkingCorrectly: false,
isCocoaPodsUpdateRequired: false,
pythonInfo: null }
Looking for project in '/home/daniel/pro/sms_api/dist'
Project directory is '/home/daniel/pro/sms_api/dist'.
Initializing analytics statuses.
Analytics statuses: { TrackFeatureUsage: 'enabled', TrackExceptions: 'enabled' }
Will send the following information to Google Analytics: { type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'event',
action: 'Check Local Build Setup',
label: 'Starting',
customDimensions: { cd5: 'CLI' } }
...
Project dir from hooksArgs is: /home/daniel/pro/sms_api/dist.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
AfterHookName for command prepareJSApp is after-prepareJSApp
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
BeforeHookName for command buildAndroidPlugin is before-buildAndroidPlugin
spawn: ./gradlew "-p" "/home/daniel/pro/sms_api/dist/platforms/tempPlugin/nativescript_messenger" "assembleRelease" "-PcompileSdk=android-27" "-PbuildToolsVersion=27.0.3" "-PsupportVersion=26.0.0-alpha1"
Unable to apply changes on device: ZY223J2852. Error is: Failed to build plugin nativescript-messenger :
Error: Command ./gradlew failed with exit code 1 Error output:
Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:60)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:62)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:91)
at sun.security.validator.Validator.getInstance(Validator.java:179)
at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
... 14 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:89)
... 26 more
.
Project dir from hooksArgs is: /home/daniel/pro/sms_api/dist.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
AfterHookName for command watch is after-watch
Project dir from hooksArgs is: /home/daniel/pro/sms_api/dist.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
AfterHookName for command liveSync is after-liveSync
sudo update-ca-certificates -f
^CProject dir from hooksArgs is: /home/daniel/pro/sms_api/dist.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
AfterHookName for command watch is after-watch
Project dir from hooksArgs is: /home/daniel/pro/sms_api/dist.
Hooks directories: [ '/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/hooks',
'/home/daniel/.nvm/versions/node/v8.11.1/lib/node_modules/nativescript/lib/common/hooks',
'/home/daniel/pro/sms_api/dist/hooks' ]
AfterHookName for command watch is after-watch
I was trying
sudo update-ca-certificates -f
but it does not help.
System
Ubuntu 18.04
java -version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
I replace openjdk by Oracle Java following by
https://github.com/mesosphere/hdfs-deprecated/issues/141
but it does not works too.
I had the same error after installing nativescript-phone.
I fixed thanks
https://stackoverflow.com/a/50103533/6398044
Bug was connected with
JEP 229, switch from the jks keystore default format to the pkcs12 format
Workaround:
sudo su
/usr/bin/printf '\xfe\xed\xfe\xed\x00\x00\x00\x02\x00\x00\x00\x00\xe2\x68\x6e\x45\xfb\x43\xdf\xa4\xd9\x92\xdd\x41\xce\xb6\xb2\x1c\x63\x30\xd7\x92' > /etc/ssl/certs/java/cacerts
/var/lib/dpkg/info/ca-certificates-java.postinst configure

ng2-material fails on jspm bundle

After a lot of time, finally I just integrated ng2-material with angular2.
However, when I bundle my app with the command below:
jspm bundle-sfx --minify --inject app/boot public/build/bundle.js
The bundle fails.
This command it doesn't work since I add the next code to my proyect:
import {MATERIAL_DIRECTIVES} from 'ng2-material/all';
Full code:
import {Component, View} from 'angular2/core';
import {Http, HTTP_PROVIDERS} from 'angular2/http';
import {NgFor} from 'angular2/common';
import Rx from 'rxjs/Rx';
import {MATERIAL_DIRECTIVES} from 'ng2-material/all';
#Component({
selector: 'my-app',
providers: [HTTP_PROVIDERS]
})
#View({
templateUrl: "app/hello.html",
directives: [NgFor,MATERIAL_DIRECTIVES]
})
export class AppComponent {
static get parameters(){
return [[Http]];
}
constructor(http){
this.name = "world";
this.http = http;
}
getNotes(){
this.http.get('/test')
.map(res => res.json())
.subscribe(
res => {this.notes = res},
err => console.error(err),
() => console.log("Notes received"));
}
}
And the log file shows:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm#3.3.12
3 info using node#v5.2.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle angular2_babel#1.0.0~prebuild: angular2_babel#1.0.0
6 silly lifecycle angular2_babel#1.0.0~prebuild: no script for prebuild, continuing
7 info lifecycle angular2_babel#1.0.0~build: angular2_babel#1.0.0
8 verbose lifecycle angular2_babel#1.0.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle angular2_babel#1.0.0~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/khaeden/Projects/vNotes/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle angular2_babel#1.0.0~build: CWD: /home/khaeden/Projects/vNotes
11 silly lifecycle angular2_babel#1.0.0~build: Args: [ '-c',
11 silly lifecycle 'jspm bundle-sfx --minify --inject app/boot public/build/bundle.js' ]
12 silly lifecycle angular2_babel#1.0.0~build: Returned: code: 1 signal: null
13 info lifecycle angular2_babel#1.0.0~build: Failed to exec build script
14 verbose stack Error: angular2_babel#1.0.0 build: `jspm bundle-sfx --minify --inject app/boot public/build/bundle.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:88:13)
14 verbose stack at EventEmitter.emit (events.js:173:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:88:13)
14 verbose stack at ChildProcess.emit (events.js:173:7)
14 verbose stack at maybeClose (internal/child_process.js:819:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:212:5)
15 verbose pkgid angular2_babel#1.0.0
16 verbose cwd /home/khaeden/Projects/vNotes
17 error Linux 3.19.0-47-generic
18 error argv "/usr/bin/nodejs" "/usr/local/bin/npm" "run" "build"
19 error node v5.2.0
20 error npm v3.3.12
21 error code ELIFECYCLE
22 error angular2_babel#1.0.0 build: `jspm bundle-sfx --minify --inject app/boot public/build/bundle.js`
22 error Exit status 1
23 error Failed at the angular2_babel#1.0.0 build script 'jspm bundle-sfx --minify --inject app/boot public/build/bundle.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2_babel package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error jspm bundle-sfx --minify --inject app/boot public/build/bundle.js
23 error You can get their info via:
23 error npm owner ls angular2_babel
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Thanks in advance.

Resources