Getting jspm_packages/npm/aurelia-bootstrapper#1.0.1.js 404 (Not Found) - jspm

I am getting the following error:
system.src.js:1041 GET http://localhost:9001/jspm_packages/npm/aurelia-bootstrapper#1.0.1.js 404 (Not Found)
W # system.src.js:1041
(anonymous) # system.src.js:1777
(anonymous) # system.src.js:1776
(anonymous) # system.src.js:2801
(anonymous) # system.src.js:3379
(anonymous) # system.src.js:3711
(anonymous) # system.src.js:4103
(anonymous) # system.src.js:4568
(anonymous) # system.src.js:4837
(anonymous) # system.src.js:408
Promise.then (async)
s # system.src.js:402
i # system.src.js:388
(anonymous) # system.src.js:544
a # system.src.js:342
(anonymous) # system.src.js:838
Promise.then (async)
import # system.src.js:831
(anonymous) # system.src.js:1800
(anonymous) # (index):24
system.src.js:123 Uncaught (in promise) Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:9001/jspm_packages/npm/aurelia-bootstrapper#1.0.1.js
Error: XHR error (404 Not Found) loading http://localhost:9001/jspm_packages/npm/aurelia-bootstrapper#1.0.1.js
Error loading http://localhost:9001/jspm_packages/npm/aurelia-bootstrapper#1.0.1.js
I have tried the following linked solution but it is not working.
SystemJS (Aurelia with jspm) fails to load "aurelia-pal-browser" from jspm_packages folder
I am have run both jspm install and npm install multiple times.
Trying to access the js file in the browser results in the error:
Cannot GET /jspm_packages/npm/aurelia-bootstrapper#1.0.1.js
I tried accessing other files as well and it seems that the only folder that is accessible is /jspm_packages/ but not the sub folders.
Any ideas?

What I did was I took the whole directory of the project from another colleague.
From his folder everything works fine.
I read somewhere these things might be a result of bugs in jspm.
In any case this was a work around.

Related

AppDynamics (Node.js/Express) dependencies broken compiling with Webpack--can anyone confirm?

Has anyone experienced Webpack dependency compiling issues when using the AppDynamics library? And did you find a way to work around it? I believe this is an issue stemming from their library.
When trying to install the AppDynamics package for monitoring a Node.js/Express application, our Webpack build process is not able to import a handful of dependencies. Specifically, the errors output are:
WARNING in ./node_modules/appdynamics/lib/core/agent.js 445:8-28
require.main.require is not supported by webpack.
# ./node_modules/appdynamics/index.js 1:17-44
# ./server.ts
ERROR in ./node_modules/appdynamics-zmq/lib/index.js
Module not found: Error: Can't resolve '../zmq' in '.../my-app/node_modules/appdynamics-zmq/lib'
# ./node_modules/appdynamics-zmq/lib/index.js 24:10-27
# ./node_modules/appdynamics-zmq/index.js
# ./node_modules/appdynamics/lib/libproxy/proxy-transport.js
# ./node_modules/appdynamics/lib/libproxy/libproxy.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-libagent/index.js
Module not found: Error: Can't resolve './appd_libagent' in '.../my-app/node_modules/appdynamics-libagent'
# ./node_modules/appdynamics-libagent/index.js 36:9-35
# ./node_modules/appdynamics/lib/libagent/libagent-connector.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-native/index.js
Module not found: Error: Can't resolve './appdynamics' in '.../my-app/node_modules/appdynamics-native'
# ./node_modules/appdynamics-native/index.js 29:10-34
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/appdynamics-protobuf/index.js
Module not found: Error: Can't resolve './protobuf_for_node' in '.../my-app/node_modules/appdynamics-protobuf'
# ./node_modules/appdynamics-protobuf/index.js 29:10-40
# ./node_modules/appdynamics/lib/libproxy/proxy-transport.js
# ./node_modules/appdynamics/lib/libproxy/libproxy.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/hipchat.js
Module not found: Error: Can't resolve 'hipchat-notifier' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/hipchat.js 3:14-41
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/loggly.js
Module not found: Error: Can't resolve 'loggly' in '.../node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/loggly.js 3:11-28
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/mailgun.js
Module not found: Error: Can't resolve 'mailgun-js' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/mailgun.js 34:14-35
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/smtp.js
Module not found: Error: Can't resolve 'nodemailer' in '.../my-app/node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/smtp.js 4:13-34
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
ERROR in ./node_modules/log4js/lib/appenders/slack.js
Module not found: Error: Can't resolve 'slack-node' in '.../node_modules/log4js/lib/appenders'
# ./node_modules/log4js/lib/appenders/slack.js 2:12-33
# ./node_modules/log4js/lib/appenders sync ^\.\/.*$
# ./node_modules/log4js/lib/log4js.js
# ./node_modules/appdynamics/lib/core/logger.js
# ./node_modules/appdynamics/lib/core/agent.js
# ./node_modules/appdynamics/index.js
# ./server.ts
Our project is set up with:
- Webpack v4.29.0
- Node.js v11.0.0
- Appdynamics v4.5
The Appdynamics usage is at the top of our server file as:
// AppDynamics monitoring
require("appdynamics").profile({
controllerHostName: ***
controllerPort: 443,
controllerSslEnabled: true,
accountName: ****
accountAccessKey: ***
applicationName: ***
tierName: ***
nodeName: '01'
});
And our Webpack configuration is:
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: { server: './server.ts' },
resolve: { extensions: ['.js', '.ts'] },
target: 'node',
// TO-DO: Enable "production" mode for going live with Universal
mode: 'development',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/node_modules/],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
},
module: {
rules: [{ test: /\.ts$/, loader: 'ts-loader' }]
},
plugins: [
]
};
So far we have tried downgrading the Webpack version, downgrading the Node environment to 10.15, and using other import methods for the AppDynamics package, but this seems like an issue internal to the Appdynamics library? The main question is, has anyone experienced Webpack dependency compiling issues when using the Appdynamics library? And did you find a way to work around it?
Any help or clues would be appreciated ❤️
The solution was adding "appdynamics" to the "externals" in the Webpack configuration: https://webpack.js.org/configuration/externals/
This allows AppDynamics to use the default Node.js require import.

Module not found: Error: Can't resolve 'dgram' in node-ssdp

After installing rokujs via npm, Can't seem to get past this error:
The package is installed correctly.
No other errors reported.
Any ideas?
ERROR in ./~/node-ssdp/lib/index.js
Module not found: Error: Can't resolve 'dgram' in 'C:\VisualStudio\Repos\App\App.PWA\node_modules\node-ssdp\lib'
# ./~/node-ssdp/lib/index.js 3:12-28
# ./~/node-ssdp ^.*index$
# ./~/node-ssdp/index.js
# ./~/rokujs/lib/roku.js
# ./~/rokujs/index.js
# ./ClientApp/app/components/home/home.component.ts
# ./ClientApp/app/app.shared.module.ts
# ./ClientApp/app/app.browser.module.ts
# ./ClientApp/boot.browser.ts
# multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts

"fs.existsSync is not a function" without touching anything related

I'm building a small web app with angular2, the only dependency so far being bootstrap for a navigation bar. One day, all works fine (including that I can see my navbar), the other day I'm cloning my repo on another machine, run npm install and ng serve, add some component/services and suddenly end up with the site not loading and this stack trace in the browser (compiling succeeds without errors though):
Uncaught TypeError: fs.existsSync is not a function
at devmode.js:33
at Object.<anonymous> (devmode.js:34)
at Object.__webpack_require__.constructor.oneshot.fn (devmode.js:34)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.<anonymous> (http.js:32)
at Object.<anonymous> (http.js:567)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.<anonymous> (index.js:29)
at Object.<anonymous> (index.js:255)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.171 (quote.service.ts:7)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.170 (routing.module.ts:37)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.90 (best.component.ts:8)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.168 (app.component.ts:8)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.157 (src async:7)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at Object.342 (main.bundle.js:549)
at __webpack_require__ (bootstrap 5d37cea67e603e9113e4:52)
at webpackJsonpCallback (bootstrap 5d37cea67e603e9113e4:23)
at main.bundle.js:1
(anonymous) # devmode.js:33
(anonymous) # devmode.js:34
__webpack_require__.constructor.oneshot.fn # devmode.js:34
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
(anonymous) # http.js:32
(anonymous) # http.js:567
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
(anonymous) # index.js:29
(anonymous) # index.js:255
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
171 # quote.service.ts:7
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
170 # routing.module.ts:37
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
90 # best.component.ts:8
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
168 # app.component.ts:8
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
157 # src async:7
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
342 # main.bundle.js:549
__webpack_require__ # bootstrap 5d37cea67e603e9113e4:52
webpackJsonpCallback # bootstrap 5d37cea67e603e9113e4:23
(anonymous) # main.bundle.js:1
After seeing the error once, I will see it the other machine too if I push & pull, though apparently nothing changed outside the content related logic that I added.
My research so far shows me mostly questions related to electron, which I don't use, or file system operations that I'm not doing. Am I missing something obvious here?
I already did the usual workarounds like deleting node_modules & rerunning npm i, I'm on npm version 5.4.0 and node 8.4.0 and I use the current version of the WebStorm-IDE.
If the same code base working fine earlier and failing later : It seems the issue is with the actual versions of NPM packages installed in both the cases.
For example :
I used an NPM package, say specialPackage with version 3.1.0
In package.json I used it as ~3.1.0.
Next day, author of specialPackage released a new patch (3.1.1) with some breaking change
I tried my app on a different machine on this day. The same package.json installs 3.1.1 instead of 3.1.0.
If there is any issue in the third-party NPM package, out app may go down.
How can we fix this?
NPM < 5.0 : One way is to always use exact NPM package versions without ~ or ^ in package.json
NPM >= 5.0 : A new package-log.json file will be generated. We need to add this to our repository, so that we expect exact versions of NPM packages that we expected.
Can you try
As you said you are using NPM >= 5.0, Do you have a package-lock.json available in the repository (where package-lock.json was created with the application running fine)
If not, try to commit the package-lock.json from the other computer and then try once again doing npm i
Try using exact NPM package versions in the package.json (by removing all ~s and ^s.
Are you using same version of #angular/cli global package on both the computers?

node-ssdp doesn't work with webpack

I'm using node-ssdp to detect an IOT device connected to the network. Both server code and client code works fine with a sample node project. My client app is in angular-electron with webpack as the module bundler. I installed node-ssdp in the angular project with
npm install node-ssdp --save
node-ssdp gets installed successfully. But then webpack fails with following errors.
ERROR in ./~/node-ssdp/test/lib/server.js
Module not found: Error: Can't resolve 'chai' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test\lib'
# ./~/node-ssdp/test/lib/server.js 3:13-28
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/lib/client.js
Module not found: Error: Can't resolve 'chai' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test\lib'
# ./~/node-ssdp/test/lib/client.js 4:13-28
# ./~/node-ssdp ^.*client$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/helper.js
Module not found: Error: Can't resolve 'sinon' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test'
# ./~/node-ssdp/test/helper.js 1:12-28
# ./~/node-ssdp/test/lib/server.js
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
ERROR in ./~/node-ssdp/test/helper.js
Module not found: Error: Can't resolve 'dgram' in 'J:\fyp\desktop-client\node_modules\node-ssdp\test'
# ./~/node-ssdp/test/helper.js 3:12-28
# ./~/node-ssdp/test/lib/server.js
# ./~/node-ssdp ^.*server$
# ./~/node-ssdp/index.js
# ./src/app/providers/pd.service.ts
# ./src/app/app.module.ts
# ./src/main.ts
# multi ./src/main.ts
I tried installing the above missing chai, sinon, dgram dependencies manually.chai and sinon errors got eliminated but not dgram.
I did tried several times and wasted few hours on this. But I was not succeeded. Can anyone suggest a solution please?

socket.io: bad request error at high trafic

when I run my socket.io chat application with high load (+500 connections), I receive that error
webSocket connection to 'ws://myIp:1400/socket.io/?EIO=3&transport=websocket&sid=GLQPwRHTgJCN9lFhAAoO' failed:
Connection closed before receiving a handshake response
socket.io.js:95 GET http://myIp:1400/socket.io/?EIO=3&transport=polling&t=1437426459994-177&sid=GLQPwRHTgJCN9lFhAAoO
400 (Bad Request)17.Request.create # socket.io.js:95Request # socket.io.js:9017.XHR.request # socket.io.js:9017.XHR.doPoll # socket.io.js:9018.Polling.poll # socket.io.js:10718.Polling.onData # socket.io.js:109(anonymous function) # socket.io.js:909.Emitter.emit # socket.io.js:3517.Request.onData # socket.io.js:9617.Request.onLoad # socket.io.js:10217.Request.create.xhr.onreadystatechange # socket.io.js:94
chat.js.php:204 Error: xhr poll error
at XHR.14.Transport.onError socket.io.js:9017.XHR.request # socket.io.js:9017.XHR.doWrite # socket.io.js:90(anonymous function) # socket.io.js:110(anonymous function) # socket.io.js:183proxy # socket.io.js:218(anonymous function) # socket.io.js:183(anonymous function) # socket.io.js:18225.exports.encodePacket #
I tried to use pm2 module but does not help.
Any idea on how to fix that ?
Cluster module doesn't play well with Socket.io 1.x
https://github.com/Unitech/PM2/issues/637

Resources