When I am setting my jspm installation with the command:
jspm init
Then it just asks me for the initial config:
Would you like jspm to prefix the jspm package.json properties under jspm? [yes]:yes
Enter server baseURL (public folder path) [./]:app
Enter jspm packages folder [app/jspm_packages]:
Enter config file path [app/config.js]:
Configuration file app/config.js doesn't exist, create it? [yes]:yes
Enter client baseURL (public folder URL) [/]:
Do you wish to use a transpiler? [yes]:no
Right after that, I am getting this error message:
warn Error on lookup for github:systemjs/systemjs
TypeError: "timeout" must be an unsigned integer
at validateTimeout (child_process.js:612:11)
at Object.exports.execFile (child_process.js:178:3)
at exports.exec (child_process.js:136:18)
at module.exports (/usr/local/lib/node_modules/jspm/node_modules/jspm-github/exec-git.js:64:5)
at /usr/local/lib/node_modules/jspm/node_modules/jspm-github/github.js:382:7
at initializePromise (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:588:5)
at new Promise (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1076:31)
at GithubLocation.lookup (/usr/local/lib/node_modules/jspm/node_modules/jspm-github/github.js:381:12)
at /usr/local/lib/node_modules/jspm/lib/registry.js:117:30
at tryCatch (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:553:13)
at /usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:628:16
at flush (/usr/local/lib/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
err
err Error downloading loader files.
err
Not sure what is happening right there. So I came here for some clues.
After trying too much to find was going on. I came with, it was happening that Jspm had no problems but my Node and Npm version were a pre-release (it seems like this affects the Jspm registry). I was using NodeJs 8.0.0. Anyway if someone stucks on the same, he/she should know that going back to
node v6.10.3 (npm v3.10.10) versions
fix this little inconvenient.
Works for me, the below commands:
brew update
brew install nvm
source $(brew --prefix nvm)/nvm.sh (adding to ~/.profile)
nvm install 6.10.3
For more information this is an excellent post about it
Related
I am currently working on a full-stack application where I need to use React for the Front-end and Rails for Back-end. I am using Esbuild which gives me access to make use of jsx in rails. However, I am having a series of issues with it as shown below. Please, how do I resolve this [ERROR] Could not resolve "app/javascript/*.*"
Could it be that it's not compatible with my system because I am seeing so many incompatibility issues in the log.
Done in 65.24s.
Add build script
run npm set-script build "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets" from "."
npm WARN set-script set-script is deprecated, use `npm pkg set scripts.scriptname="cmd" instead.
run yarn build from "."
yarn run v1.22.15
warning ..\package.json: No license field
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
X [ERROR] Could not resolve "app/javascript/*.*"
It looks like you are trying to use glob syntax (i.e. "*") with esbuild. This syntax is
typically handled by your shell, and isn't handled by esbuild itself. You must expand glob
syntax first before passing your paths to esbuild.
1 error
node:child_process:879
throw err;
^
Error: Command failed: C:\Users\Dennis\hello-rails-react\node_modules\esbuild-windows-64\esbuild.exe app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
I had the same error while building my rails application.
In the package.json file. In the scripts section, Instead of a general path
app/javascript/*.*
I specified the exact file name
app/javascript/application.js
and my problem was solved.
So I've made the big mistake of updating npm and node from versions 3.10.10 and 6.10.2, respectively to 5.6.0 and 9.3.0
Now my app doesn't work so I am getting quite desperate here. When I attempt to run it, I get the following error:
/Users/me/Workspace/MyApp/node_modules/node-sass/lib/binding.js:13
throw new Error(errors.unsupportedEnvironment());
^
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (59)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.5.3
I've looked up the error and haven't found much, except deleting the node_modules folder and doing npm install. Neither of which work. This now gives me the following error:
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3#3.1.8 and node#9.3.0 (node-v59 ABI) (falling back to source compile with node-gyp)
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
I am not sure where to go from here but am not getting desperate. What is going on? Is there anything I can do or should I just reverse to a previous version of node and npm?
You'll need to run npm rebuild, because Node-sass uses C++ addons, and that command
runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.
There's probably also no reason not to update node-sass to the current release 4.7.2.
Have a look at another handy package called ncu that can help you bulk-upgrade your package.json. Don't do it carelessly, you may create instability, but it's a handy start if you have a small number of specified dependencies.
I used npm for several months.
But after I install python/django and virtual environment, it's not working anymore.
The error is smething like this.
sudo npm install -g react-native-cli
module.js:341
throw err;
^Error: Cannot find module './cache/caching-client.js'
I used npm for several days but this happened first time. I searched to solve issue and found this link
Installing MEAN Stack: npm -v module.js: 338 throw err; Error: Cannot find module './cache/caching-client.js'.
But not working.
echo $NODE_PATH
/usr/local/lib/node_modules
And it occurs on all npm commands.
npm -v
npm init -y
I reinstalled the node.js again and it worked.:)
f you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, like RCTText.xcodeproj, RCTImage.xcodeproj. Next, the binaries built by these dependencies have to be linked to your app binary. Use the Linked Frameworks and Binaries section in the Xcode project settings. More detailed steps are here: Linking Libraries.
If you are using CocoaPods, verify that you have added React along with the subspecs to the Podfile. For example, if you were using the , and fetch() APIs, you would need to add these in your Podfile:
for more see this
https://www.npmjs.com/package/react-native-winjs-cli/tutorial
I have installed node.js on my Windows-7 PC. I am not able to create websocket connection to a remote server.
I tried to load modeule "ws" in my script :
var WebSocket = require('ws')
It gave an error :
cannot find module 'ws'
So I followed instructions over here : node.js websocket module installed but won't work in scripts
Execute cmd as Administrator (Right click cmd icon-> Run as Administrator) Then type in cmd:
c:\Node Instalation Dir\> npm install -g express
c:\Node Instalation Dir\> npm install websocket --force
Then run my script :--
D:\My Script Folder \> node myscript.js
Again same error. What could be the problem ?
cannot find module 'ws'
If you install websocket, you should require websocket, not ws:
npm install websocket
Then in REPL:
var websocket = require('websocket');
Alternatively, you can use ws module:
npm install ws
Repl/script:
var ws = require('ws');
Take a look at your node_modules directory (only the first level, the dirs right beneath it). You can require each of them by exact name.
require will actually look for a node_modules in current dir, then if not found, then the parent and again parent etc. If it doesn't find it, it will look for modules installed in global path pointed to by NODE_PATH. (And of course, native modules such as http and net.)
Try to install the package locally but not globally, i.e. without the -g option.
Have you installed the module with the -g option? I think that not every module is meant to be installed globally, instead, try installing it locally for the project you are creating (npm install), and check if the error persists. [...]
If you want to just require('something'); it is better to install it locally, otherwise, you have to require('{PREFIX}something'), where prefix is the path to where yo have installed it globally. Check out this blog post , and, as it says, generally the rule of thumb is to install things locally if you are going to use them in your app, and globally if you are going to use them from the command line.
node error cannot find module already installed.
Go to your project root directory and open the package.json file and edit
Add "type":"module";
Go to the top of your js file, delete the require and use the import statement to import 'ws' into your script.
I was also facing the same issue.
Error 1:
Just simply trying npm install ws to the same folder level where I had my server.js worked for me.
Error 2:
If you are getting the error WebSocket is not defined, then try the command npm install ws, after adding the below code. if ws doesn't work then try npm install websocket
Also, add this in your file:
const WebSocket = require('ws');
var conn = new WebSocket('ws://localhost:9090');
I have got a Nodejs app on AppFog and want to connect to a ftp-server with this.
I did install it with npm install ftp using "Ruby Command Prompt"
This is the only code line:
var FTPClient = require('ftp');
Trying to start the app, it throws an error:
Skipping npm-support: npm-shrinkwrap.json is not provided
Which kind of server should I use or what's the problem?
Still doesn't start:
Starting Application 'test007': .
Error: Application [test007] failed to start, logs information below.
====> /logs/staging.log <====
# Logfile created on 2013-03-09 10:37:09 +0000 by logger.rb/25413
Installing dependencies. Node version 0.8.14
Installing ftp#0.2.9 from local path
Installing xregexp#2.0.0 from local path
Installing node#0.0.0 from local path
Installing nodejs#0.0.1 from local path
But no error is shown.
Thanks in advance
The quick fix is to type npm shrinkwrap, which will provide an npm-shrinkwrap file.
A shrinkwrap file fixes the exact versions of your dependencies, and the exact version of their dependencies, and so on. Without it, each usage of npm install could install different versions of the packages -- sometimes, just different bugfix versions (1.4.2 vs 1.4.3), but sometimes much greater differences. There's no guarantee that your code will work with different dependency versions (in fact it is not uncommon to break), so shrinkwrapping is a great idea for any production-level code.
If you want to 'unshrinkwrap', just delete the npm-shrinkwrap.json. You can re-shrinkwrap at any point.