Install error on Vite project with Svelte - node.js

I want to try out svelte, but whenever I try to install all the npm dependencies it just won't work.
Here's the latest log from the npm install command:
358 verbose stack Error: command failed
358 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\lib\index.js:63:27)
358 verbose stack at ChildProcess.emit (node:events:513:28)
358 verbose stack at maybeClose (node:internal/child_process:1093:16)
358 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
359 verbose pkgid esbuild#0.14.54
360 verbose cwd C:\Users\[name]\Documents\svelte\svelteproject
361 verbose Windows_NT 10.0.19044
362 verbose node v16.17.0
363 verbose npm v8.15.0
364 error code 1
365 error path C:\Users\[name]\Documents\svelte\svelteproject\node_modules\esbuild
366 error command failed
367 error command C:\Windows\system32\cmd.exe /d /s /c C:\Users\[name]\AppData\Local\Temp\postinstall-348afd82.cmd
368 error node:internal/errors:477
368 error ErrorCaptureStackTrace(err);
368 error ^
368 error
368 error <ref *1> Error: spawnSync node ENOENT
368 error at Object.spawnSync (node:internal/child_process:1112:20)
368 error at spawnSync (node:child_process:827:24)
368 error at Object.execFileSync (node:child_process:870:15)
368 error at validateBinaryVersion (C:\Users\[name]\Documents\svelte\svelteproject\node_modules\esbuild\install.js:89:32)
368 error at C:\Users\[name]\Documents\svelte\svelteproject\node_modules\esbuild\install.js:240:5 {
368 error errno: -4058,
368 error code: 'ENOENT',
368 error syscall: 'spawnSync node',
368 error path: 'node',
368 error spawnargs: [
368 error 'C:\\Users\\[name]\\Documents\\svelte\\svelteproject\\node_modules\\esbuild\\bin\\esbuild',
368 error '--version'
368 error ],
368 error error: [Circular *1],
368 error status: null,
368 error signal: null,
368 error output: null,
368 error pid: 0,
368 error stdout: null,
368 error stderr: null
368 error }
369 verbose exit 1
370 timing npm Completed in 8482ms
371 verbose unfinished npm timer reify 1662249334912
372 verbose unfinished npm timer reify:build 1662249342838
373 verbose unfinished npm timer build 1662249342839
374 verbose unfinished npm timer build:deps 1662249342839
375 verbose unfinished npm timer build:run:postinstall 1662249342853
376 verbose unfinished npm timer build:run:postinstall:node_modules/esbuild 1662249342854
377 verbose code 1
378 error A complete log of this run can be found in:
378 error C:\Users\[name]\AppData\Local\npm-cache\_logs\2022-09-03T23_55_34_708Z-debug-0.log
I created the project by running npm init vite and followed all the steps. The only issue arose when I ran the npm install command in the root directory of the project.

Related

Why I can't install packages with npm?

Trying simple command npm i --legacy-peer-deps and this is what i get:
1474 verbose type system
1475 verbose stack FetchError: Invalid response body while trying to fetch https://registry.npmjs.org/#nrwl%2freact: 12620:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
1475 verbose stack
1475 verbose stack at C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\body.js:168:15
1475 verbose stack at processTicksAndRejections (internal/process/task_queues.js:95:5)
1475 verbose stack at async RegistryFetcher.packument (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\registry.js:99:25)
1475 verbose stack at async RegistryFetcher.manifest (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\registry.js:124:23)
1475 verbose stack at async Arborist.[nodeFromEdge] (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\bui ld-ideal-tree.js:1107:19)
1475 verbose stack at async Arborist.[buildDepStep] (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\bui ld-ideal-tree.js:976:11)
1475 verbose stack at async Arborist.buildIdealTree (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\bui ld-ideal-tree.js:218:7)
1475 verbose stack at async Promise.all (index 1)
1475 verbose stack at async Arborist.reify (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\#npmcli\arborist\lib\arborist\reify.js:154:5)
1475 verbose stack at async Install.exec (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\commands\install.js:145:5)
1476 verbose cwd D:\Samir\Projects\GO\gomango-next
1477 verbose Windows_NT 10.0.19044
1478 verbose node v14.19.3
1479 verbose npm v8.16.0
1480 error code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
1481 error errno ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
1482 error Invalid response body while trying to fetch https://registry.npmjs.org/#nrwl%2freact: 12620:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
1482 error
1483 verbose exit 1
1484 timing npm Completed in 33810ms
1485 verbose unfinished npm timer reify 1660050096991
1486 verbose unfinished npm timer reify:loadTrees 1660050097001
1487 verbose code 1
1488 error A complete log of this run can be found in:
1488 error C:\Users\User\AppData\Local\npm-cache\_logs\2022-08-09T13_01_36_761Z-debug-0.log
node version: 14.19.3
npm version: 8.16.0
OS: Windows

Google Firebase functions to iot device send config

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.

Cannot run npm run build or npm start

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

Error Installing Yeoman on windows: "getaddrinfo eai_again registry.npmjs.org:80"

I am on a corporate network and I am trying to install Yeoman on my system using:
npm install -g yo
I have npm and node installed on my system.
I am getting this error:
getaddrinfo eai_again registry.npmjs.org:80
Here's is the 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:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'yo' ]
2 info using npm#3.8.3
3 info using node#v5.10.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData yo
8 silly fetchNamedPackageData yo
9 silly mapToRegistry name yo
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry http://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'yo',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry name: 'yo',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri http://registry.npmjs.org/yo
14 verbose request uri http://registry.npmjs.org/yo
15 verbose request no auth needed
16 info attempt registry request try #1 at 2:38:43 PM
17 verbose request id 09d26a48e3785699
18 http request GET http://registry.npmjs.org/yo
19 info retry will retry, error on last attempt: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:80
20 info attempt registry request try #2 at 2:38:53 PM
21 http request GET http://registry.npmjs.org/yo
22 info retry will retry, error on last attempt: Error: getaddrinfo EAI_AGAIN registry.npmjs.org:80
23 info attempt registry request try #3 at 2:39:53 PM
24 http request GET http://registry.npmjs.org/yo
25 silly fetchPackageMetaData Error: getaddrinfo EAI_AGAIN registry.npmjs.org:80
25 silly fetchPackageMetaData at Object.exports._errnoException (util.js:890:11)
25 silly fetchPackageMetaData at errnoException (dns.js:31:15)
25 silly fetchPackageMetaData at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
25 silly fetchPackageMetaData error for yo { [Error: getaddrinfo EAI_AGAIN registry.npmjs.org:80]
25 silly fetchPackageMetaData code: 'EAI_AGAIN',
25 silly fetchPackageMetaData errno: 'EAI_AGAIN',
25 silly fetchPackageMetaData syscall: 'getaddrinfo',
25 silly fetchPackageMetaData hostname: 'registry.npmjs.org',
25 silly fetchPackageMetaData host: 'registry.npmjs.org',
25 silly fetchPackageMetaData port: 80 }
26 silly rollbackFailedOptional Starting
27 silly rollbackFailedOptional Finishing
28 silly runTopLevelLifecycles Starting
29 silly runTopLevelLifecycles Finishing
30 silly install printInstalled
31 verbose stack Error: getaddrinfo EAI_AGAIN registry.npmjs.org:80
31 verbose stack at Object.exports._errnoException (util.js:890:11)
31 verbose stack at errnoException (dns.js:31:15)
31 verbose stack at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
32 verbose cwd C:\windows\system32
33 error Windows_NT 6.3.9600
34 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yo"
35 error node v5.10.0
36 error npm v3.8.3
37 error code EAI_AGAIN
38 error errno EAI_AGAIN
39 error syscall getaddrinfo
40 error getaddrinfo EAI_AGAIN registry.npmjs.org:80
41 error If you need help, you may report this error at:
41 error <https://github.com/npm/npm/issues>
42 verbose exit [ 1, true ]
Any suggestions?
I saw these links:
Error installing yeoman
https://github.com/npm/npm/issues/11308

i start server success but client connect it have error node.js

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});

Resources