I am not able to get any proper test result from my npm run test.getting this following error. how to fix it?
FAIL src/app/shared-components/services/shared-service.spec.ts
● Test suite failed to run
D:\IBO\Project\IBO-UI\NG-IBO\src\setup-jest.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import 'jest-preset-angular';
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected string
at ScriptTransformer._transformAndBuildScript (node_modules/#jest/transform/build/ScriptTransformer.js:471:17)
at ScriptTransformer.transform (node_modules/#jest/transform/build/ScriptTransformer.js:513:25)
at Array.forEach (<anonymous>)
Any one help me to fix this please?
Here is the log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\722333\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'test' ]
2 info using npm#6.9.1-next.0
3 info using node#v11.10.0
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle ibo#0.0.0~pretest: ibo#0.0.0
6 info lifecycle ibo#0.0.0~test: ibo#0.0.0
7 verbose lifecycle ibo#0.0.0~test: unsafe-perm in lifecycle true
8 verbose lifecycle ibo#0.0.0~test: PATH: C:\Users\722333\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\IBO\Project\IBO-UI\NG-IBO\node_modules\.bin;C:\Users\722333\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\722333\AppData\Local\Programs\Python\Python37-32\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\722333\AppData\Local\Microsoft\WindowsApps;D:\mongodb\bin;D:\Git\bin;C:\Users\722333\AppData\Local\Programs\Common\Microsoft VS Code\bin;C:\Users\722333\AppData\Roaming\npm;C:\Users\722333\AppData\Local\Programs\Python\Python37-32;
9 verbose lifecycle ibo#0.0.0~test: CWD: D:\IBO\Project\IBO-UI\NG-IBO
10 silly lifecycle ibo#0.0.0~test: Args: [ '/d /s /c', 'jest' ]
11 silly lifecycle ibo#0.0.0~test: Returned: code: 1 signal: null
12 info lifecycle ibo#0.0.0~test: Failed to exec test script
13 verbose stack Error: ibo#0.0.0 test: `jest`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\722333\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:197:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\722333\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:197:13)
13 verbose stack at maybeClose (internal/child_process.js:984:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid ibo#0.0.0
15 verbose cwd D:\IBO\Project\IBO-UI\NG-IBO
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\722333\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
18 verbose node v11.10.0
19 verbose npm v6.9.1-next.0
20 error code ELIFECYCLE
21 error errno 1
22 error ibo#0.0.0 test: `jest`
22 error Exit status 1
23 error Failed at the ibo#0.0.0 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Without knowing your jest.config.js file or your global jest configuration I would say that you have not configured you're exposed configuration properly. And more specifically the transform property. It should look like this:
module.exports = {
...
transform: {
"^.+\\.(ts|js|html)$": "ts-jest"
},
};
For further help on the topic read this.
Hope that helps!
Related
Seem to have this problem even if i reinstalled it, deleted node-modules/package-lock.json/ downgraded to a earlier version
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Users\\Shaimz\\Desktop\\work\\Programs\\node.exe',
1 verbose cli 'C:\\Users\\Shaimz\\Desktop\\work\\Programs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#6.9.0
3 info using node#v10.16.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-app#1.0.0~prebuild: my-app#1.0.0
6 info lifecycle my-app#1.0.0~build: my-app#1.0.0
7 verbose lifecycle my-app#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-app#1.0.0~build: PATH: C:\Users\Shaimz\Desktop\work\Programs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Shaimz\Desktop\work\node\my-app\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files\010 Editor;C:\FPC\3.0.4\bin\i386-Win32;D:\Programs\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Users\Shaimz\Desktop\work\Programs\;D:\Programs\Microsoft VS Code\bin;C:\Users\Shaimz\AppData\Local\GitHubDesktop\bin;C:\Users\Shaimz\AppData\Roaming\npm
9 verbose lifecycle my-app#1.0.0~build: CWD: C:\Users\Shaimz\Desktop\work\node\my-app
10 silly lifecycle my-app#1.0.0~build: Args: [ '/d /s /c', 'webpack' ]
11 silly lifecycle my-app#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle my-app#1.0.0~build: Failed to exec build script
13 verbose stack Error: my-app#1.0.0 build: `webpack`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Shaimz\Desktop\work\Programs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Shaimz\Desktop\work\Programs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid my-app#1.0.0
15 verbose cwd C:\Users\Shaimz\Desktop\work\node\my-app
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Users\\Shaimz\\Desktop\\work\\Programs\\node.exe" "C:\\Users\\Shaimz\\Desktop\\work\\Programs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.16.3
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error my-app#1.0.0 build: `webpack`
22 error Exit status 1
23 error Failed at the my-app#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
WEBPACK config right here :
var React = require('react');
var ReactDOM = require('react-dom');
var App = require('./components/App');
ReactDOM.render(
<App/>,
document.getElementById('app')
);
var HTMLWebpackPlugin = require('html-webpack-plugin');
var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
template: __dirname + '/app/index.html',
filename:'index.html',
inject:'head'
});
module.exports = {
entry: ['./app/index.js'],
module:{
loaders:[
{
test: /\.js$/,
exclude: /node_modules/,
loader:'babel-loader'
}
]
},
output:{
path:__dirname + '/build',
filename:'file.js'
},
plugins:[HTMLWebpackPluginConfig]
};
I think that's the formated code , sorry , i'm new to stackoverflow.I wish you could help me with that problem , i was starting to think maybe i do something wrong but i dont think soo , i was watching carefully a guide on codecademy
posting the full log saved from framedwork FYI as below, might also be a memory leaking issue??
assert.js:42 throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: false == true
debug log details as below:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node#8/8.12.0/bin/node',
1 verbose cli '/usr/local/opt/node#8/bin/npm',
1 verbose cli 'start' ]
2 info using npm#6.4.1
3 info using node#v8.12.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle wm-admin#0.0.0~prestart: wm-admin#0.0.0
6 verbose lifecycle wm-admin#0.0.0~prestart: unsafe-perm in lifecycle true
7 verbose lifecycle wm-admin#0.0.0~prestart: PATH: /usr/local/Cellar/node#8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/usern/Projects/Vri/wm-admin/node_modules/.bin:/usr/local/opt/node#8/bin:/usr/local/opt/node#8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/usern/Projects/i/gopath/bin
8 verbose lifecycle wm-admin#0.0.0~prestart: CWD: /Users/usern/Projects/Vri/wm-admin
9 silly lifecycle wm-admin#0.0.0~prestart: Args: [ '-c', 'npm run versions' ]
10 silly lifecycle wm-admin#0.0.0~prestart: Returned: code: 0 signal: null
11 info lifecycle wm-admin#0.0.0~start: wm-admin#0.0.0
12 verbose lifecycle wm-admin#0.0.0~start: unsafe-perm in lifecycle true
13 verbose lifecycle wm-admin#0.0.0~start: PATH: /usr/local/Cellar/node#8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/user/Projects/Vi/wm-admin/node_modules/.bin:/usr/local/opt/node#8/bin:/usr/local/opt/node#8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/quin/Projects/Viri/gopath/bin
14 verbose lifecycle wm-admin#0.0.0~start: CWD: /Users/quin/Projects/Viri/wm-admin
15 silly lifecycle wm-admin#0.0.0~start: Args: [ '-c',
15 silly lifecycle 'ng serve --ssl --host 0.0.0.0 --port 4200 --proxy-config proxies/proxy.test.conf.json' ]
16 silly lifecycle wm-admin#0.0.0~start: Returned: code: 1 signal: null
17 info lifecycle wm-admin#0.0.0~start: Failed to exec start script
18 verbose stack Error: wm-admin#0.0.0 start: `ng serve --ssl --host 0.0.0.0 --port 4200 --proxy-config proxies/proxy.test.conf.json`
18 verbose stack Exit status 1
18 verbose stack at EventEmitter.<anonymous> (/usr/local/Cellar/node#8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
18 verbose stack at emitTwo (events.js:126:13)
18 verbose stack at EventEmitter.emit (events.js:214:7)
18 verbose stack at ChildProcess.<anonymous> (/usr/local/Cellar/node#8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
18 verbose stack at emitTwo (events.js:126:13)
18 verbose stack at ChildProcess.emit (events.js:214:7)
18 verbose stack at maybeClose (internal/child_process.js:915:16)
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
19 verbose pkgid wm-admin#0.0.0
20 verbose cwd /Users/quin/Projects/Vi/wm-admin
21 verbose Darwin 18.2.0
22 verbose argv "/usr/local/Cellar/node#8/8.12.0/bin/node" "/usr/local/opt/node#8/bin/npm" "start"
23 verbose node v8.12.0
24 verbose npm v6.4.1
25 error code ELIFECYCLE
26 error errno 1
27 error wm-admin#0.0.0 start: `ng serve --ssl --host 0.0.0.0 --port 4200 --proxy-config proxies/proxy.test.conf.json`
27 error Exit status 1
28 error Failed at the wm-admin#0.0.0 start script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]
this might also the problem of a nodejs problem that causing too many calls that crashes the system, tried a lot of googling still no one can explain this.
I am trying to use firebase functions to send config to an Iot device.Here is the tutorial which i am trying to use.This is the Node js code which i am deploying
The tutorial says after, after deployment whatever change i will do to my firebase database it will get sent to the iot device as device config.
registryid is INTERNET_OF_BULBS.
Iot device name is Iot-device-1.
The actual code in the tutorial doesnt work for deployment.So I removed the import modules part and used require.
The tutorial does these imports.
import * as admin from "firebase-admin";
import * as functions from 'firebase-functions';
import { runInDebugContext } from 'vm';
import { DeviceManager } from './devices';
how do i import { DeviceManager } from './devices';
so i am doing only 2 imports.Otherwise ,if i use import in my index.js it gives error when deploying.
1:1 error Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
Below is my index.js file.
const admin =require('firebase-admin');
const functions =require('firebase-functions');
admin.initializeApp();
// create a device manager instance with a registry id, optionally pass a region
const dm = new DeviceManager('INTERNET_OF_BULBS');
const firestore = admin.firestore();
// start cloud function
exports.configUpdate = functions.firestore
// assumes a document whose ID is the same as the deviceid
.document('device-configs/Iot-device-1')
.onWrite((change,context) => {
var beforeData = change.before.val(); // data before the write
var afterData = change.after.val();
if (context) {
await dm.setAuth();
console.log(context.params.deviceId);
// get the new config data
const configData = change.after.data();
return dm.updateConfig(context.params.deviceId, configData);
} else {
throw(Error("no context from trigger"));
}
})
Here is the error on my shell when i am trying to deploy,the above code.
firebase deploy
=== Deploying to 'wifi-lights-88783'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions# lint /home/suposhmehta/fire/functions
> eslint .
/home/suposhmehta/fire/functions/index.js
17:13 error Parsing error: Unexpected token dm
✖ 1 problem (1 error, 0 warnings)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions# lint: `eslint .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions# lint 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! /home/suposhmehta/.npm/_logs/2018-11-10T09_38_15_585Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code1
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/nvm/versions/node/v8.9.4/bin/node',
1 verbose cli '/usr/local/nvm/versions/node/v8.9.4/bin/npm',
1 verbose cli '--prefix',
1 verbose cli '/home/suposhmehta/fire/functions',
1 verbose cli 'run',
1 verbose cli 'lint' ]
2 info using npm#5.6.0
3 info using node#v8.9.4
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info lifecycle functions#~prelint: functions#
6 info lifecycle functions#~lint: functions#
7 verbose lifecycle functions#~lint: unsafe-perm in lifecycle true
8 verbose lifecycle functions#~lint: PATH: /usr/local/nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/suposhmehta/fire/functions/node_
modules/.bin:/home/suposhmehta/gopath/bin:/google/gopath/bin:/google/google-cloud-sdk/bin:/usr/local/go/bin:/opt/gradle/bin:/opt/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbi
n:/usr/bin:/sbin:/bin:/usr/local/nvm/versions/node/v8.9.4/bin:/google/go_appengine:/google/google_appengine
9 verbose lifecycle functions#~lint: CWD: /home/suposhmehta/fire/functions
10 silly lifecycle functions#~lint: Args: [ '-c', 'eslint .' ]
11 silly lifecycle functions#~lint: Returned: code: 1 signal: null
12 info lifecycle functions#~lint: Failed to exec lint script
13 verbose stack Error: functions# lint: `eslint .`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid functions#
15 verbose cwd /home/suposhmehta/fire
16 verbose Linux 4.14.33+
17 verbose argv "/usr/local/nvm/versions/node/v8.9.4/bin/node" "/usr/local/nvm/versions/node/v8.9.4/bin/npm" "--prefix" "/home/suposhmehta/fire/functions" "run" "lint"
18 verbose node v8.9.4
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error functions# lint: `eslint .`
22 error Exit status 1
23 error Failed at the functions# lint script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
How do i get rid of these issues?
Please Help.
Whenever I try building my web-pack file or starting web-pack dev server I get an error. It was working, but I was messing around with eslint and broke something.
This is the error package when trying npm build
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm#4.5.0
3 info using node#v6.10.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle setup#1.0.0~prebuild: setup#1.0.0
6 silly lifecycle setup#1.0.0~prebuild: no script for prebuild, continuing
7 info lifecycle setup#1.0.0~build: setup#1.0.0
8 verbose lifecycle setup#1.0.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle setup#1.0.0~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Nims/Documents/Web Development/Projects/React bookstore/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle setup#1.0.0~build: CWD: /Users/Nims/Documents/Web Development/Projects/React bookstore
11 silly lifecycle setup#1.0.0~build: Args: [ '-c', 'webpack' ]
12 silly lifecycle setup#1.0.0~build: Returned: code: 1 signal: null
13 info lifecycle setup#1.0.0~build: Failed to exec build script
14 verbose stack Error: setup#1.0.0 build: `webpack`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid setup#1.0.0
16 verbose cwd /Users/Nims/Documents/Web Development/Projects/React bookstore
17 verbose Darwin 16.5.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
19 verbose node v6.10.3
20 verbose npm v4.5.0
21 error code ELIFECYCLE
22 error errno 1
23 error setup#1.0.0 build: `webpack`
23 error Exit status 1
24 error Failed at the setup#1.0.0 build script 'webpack'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the setup package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error webpack
24 error You can get information on how to open an issue for this project with:
24 error npm bugs setup
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls setup
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
and when trying npm start
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm#4.5.0
3 info using node#v6.10.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle setup#1.0.0~prestart: setup#1.0.0
6 silly lifecycle setup#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle setup#1.0.0~start: setup#1.0.0
8 verbose lifecycle setup#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle setup#1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Nims/Documents/Web Development/Projects/React bookstore/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle setup#1.0.0~start: CWD: /Users/Nims/Documents/Web Development/Projects/React bookstore
11 silly lifecycle setup#1.0.0~start: Args: [ '-c', 'webpack-dev-server' ]
12 silly lifecycle setup#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle setup#1.0.0~start: Failed to exec start script
14 verbose stack Error: setup#1.0.0 start: `webpack-dev-server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid setup#1.0.0
16 verbose cwd /Users/Nims/Documents/Web Development/Projects/React bookstore
17 verbose Darwin 16.5.0
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 verbose node v6.10.3
20 verbose npm v4.5.0
21 error code ELIFECYCLE
22 error errno 1
23 error setup#1.0.0 start: `webpack-dev-server`
23 error Exit status 1
24 error Failed at the setup#1.0.0 start script 'webpack-dev-server'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the setup package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error webpack-dev-server
24 error You can get information on how to open an issue for this project with:
24 error npm bugs setup
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls setup
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
Here is my webpack file
module.exports = {
entry: ['babel-polyfill', './app/index.js'],
output: {
path: __dirname + '/build',
// if the above line does not work, try `path: __dirname + '/build'`
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/, // a regular expression that catches .js files
exclude: /node_modules/,
loader: ['babel-loader']
}
],
},
devServer: {
port: 3000, // most common port
contentBase: './build',
inline: true
}
};
It seems its not picking up the local scripts in my webpack.config.js file - but I'm new to this and I'm still learning
Try deleting the node_modules, and then run the script.
May not have been installed in npm global and then install them separately and then run the regular npm install without root privileges:
sudo npm install -g coffee-script node-gyp
npm install
i start server success but client connect it have error
https://jsfiddle.net/m9wvm4nu/3/ (in css is file debuglog)
here is file debuglog if u dont need my code in node . I dont know what happening
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\nodejs\\node.exe',
1 verbose cli 'C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#3.3.12
3 info using node#v5.1.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle simple-website#1.0.0~prestart: simple-website#1.0.0
6 silly lifecycle simple-website#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle simple-website#1.0.0~start: simple-website#1.0.0
8 verbose lifecycle simple-website#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle simple-website#1.0.0~start: PATH: C:\nodejs\node_modules\npm\bin\node-gyp-bin;D:\1-PROJECT\simple-website\node_modules\.bin;C:\Users\MyPC\bin;C:\Users\MyPC\AppData\Local\Programs\Git\mingw64\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\local\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin;C:\Users\MyPC\AppData\Local\Programs\Git\mingw64\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin;C:\Users\MyPC\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Skype\Phone;C:\nodejs;C:\Users\MyPC\AppData\Local\atom\bin;C:\Users\MyPC\AppData\Local\.meteor;C:\Users\MyPC\AppData\Roaming\npm;C:\Users\MyPC\AppData\Local\Programs\Git\cmd;C:\Users\MyPC\AppData\Local\Programs\Git\mingw64\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin\vendor_perl;C:\Users\MyPC\AppData\Local\Programs\Git\usr\bin\core_perl
10 verbose lifecycle simple-website#1.0.0~start: CWD: D:\1-PROJECT\simple-website
11 silly lifecycle simple-website#1.0.0~start: Args: [ '/d /s /c', 'node server.js' ]
12 silly lifecycle simple-website#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle simple-website#1.0.0~start: Failed to exec start script
14 verbose stack Error: simple-website#1.0.0 start: `node server.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\nodejs\node_modules\npm\lib\utils\lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess.<anonymous> (C:\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:818:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid simple-website#1.0.0
16 verbose cwd D:\1-PROJECT\simple-website
17 error Windows_NT 10.0.10240
18 error argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v5.1.0
20 error npm v3.3.12
21 error code ELIFECYCLE
22 error simple-website#1.0.0 start: `node server.js`
22 error Exit status 1
23 error Failed at the simple-website#1.0.0 start script 'node server.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 simple-website package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node server.js
23 error You can get their info via:
23 error npm owner ls simple-website
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
I'm not sure exactly what is causing your specific error, but this is a problem in your script:
var mineType = mineType[path.extname(fileName).split(".").reverse()[0]];
res.writeHead(200, {'content-Type': mineType});
You can't use the same variable name for your mineType table and for a local variable. Change the local variable to a different variable name:
var type = mineType[path.extname(fileName).split(".").reverse()[0]];
res.writeHead(200, {'content-Type': type});