I tried to install ionic but it returns : npm ERR! code E418 - ionic-framework

I have a serious problem. I tried to install ionic, cordova, angular, react-native-cli, https-status-error and other packages and it always returns:
npm ERR! code E418
npm ERR! 418 I'm a teapot: ionic # latest
Please note that it may be wrong and I do not understand what is happening. It was fine until 3 days ago.

So, post may 29th '18, this is the common error being faced worldwide by devs working behind corporate proxies. The following tweak fixed the issue for me:
Go to your .npmrc file.
you'll have the following similar content in the file depending upon the configs you are setting up-
strict-ssl=false
registry=http://registry.npmjs.org/
python=C:/Python27/python.exe
msvs_version=2015
http-proxy=<WHATEVER-PROXY-YOU-USUALLY-ADD>:8000
Note: Ignore the extra configs like python variable path.
Update the registry link to 'https://registry.npmjs.org/'. So your file would look like this now-
strict-ssl=false
registry=https://registry.npmjs.org/
python=C:/Python27/python.exe
msvs_version=2015
http-proxy=<WHATEVER-PROXY-YOU-USUALLY-ADD>:8000
And Viola! you are all set to fire your npm install commands :)

Work for me!
If you set proxy should be unset.
npm config delete proxy
npm config delete https-proxy
Solution resolve npm ^___^
npm cache clean --force
npm cache verify

I had the very same issue and managed to fix it.
In my case, I initially had the value of "http://registry.npmjs.org/" and changed it to "https". Below are the set of commands I ran:
npm config set registry https://registry.npmjs.org/
npm cache clean --force
npm cache verify
npm install

we have to add proxy information in .npmrc file with userid and password. You will not find any issues. Recently people are getting http 418 - tea pot issues. That we can fix setting up registry with https like below
USE THIS:
proxy=http://<>:<>#<>:8080/
https-proxy=http://<>:<>#<>:8080/
registry=https://registry.npmjs.org

Are you behind a coorporate proxy? I was facing the same error when I tried to run npm install. What I did was to remove the proxy configuration from NPM, like so:
npm config rm proxy
npm config rm https-proxy
That did the trick.

418 I’m a teapot: This code was defined in 1998 as one of the traditional IETF April Fools’ jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers.
However, we know at least one implementation does exist now.
It's a bug or weird joke.
As #TomLingham suggested, follow https://github.com/npm/npm/issues/20791 to watch progress resolving the issue and for some workarounds.
For example yarn still healthy.

After visiting many sites and testing everything i found,
This Solution finally worked for me. If you are using Windows,
Click windows button and type "run"
Type .npmrc and open this file using your favorite editor.
Replace "registry=http://registry.npmjs.org/" with "registry=https://registry.npmjs.org/" and save.
Note: If you have any proxy issues too..you can set your proxy like below in the same file. In my case i have a special symbol "#" in my password.
When i tried changing proxy using npm config set proxy command these special characters got converted to something else :) So you could eliminate all these headaches if you set your proxy along in this file directly.
Your final .npmrc should look like below. you could remove proxy lines if you do not have any issues with proxy and do not forget to replace the port in below example with your proxy port.
registry=https://registry.npmjs.org/
proxy=http://username:password#yourproxy.net:8080/
https-proxy=http://username:password#yourproxy.net:8080/
strict-ssl=false

I too ran into the same problem today, It looks like we all are in the same boat.
https://github.com/npm/npm/issues/20791. Some solutions are provided in the link. You might want to look into it if it is a pressing issue.

Related

SchedulerLike is not an exported member

So I was going to work on an Ionic app that I was working on last year and I didn't change anything in framework or anything. So I launch the command "ionic serve" and my app crashes saying a lot of imports don't work like in the picture:
I've tried installing rxjs-compat (even though I haven't updated rxjs) and still doesn't work.
I just did "npm i" just in case something was missing and then launched my app.
Does anyone know what could be the reason that is making everything crash?
Looks like you got unexpected updates.
Please check root directory of your project, if npm i didn't work it means you don't have package-lock.json. If you have it - try to delete node_modules and execute npm install again.
Also check whether yarn.lock is there, then you need to use yarn to install proper packages.
Without yarn.lock and package-lock.json you can only guess suitable versions.
If you remember a date when it worked - try to check which versions were actual then on http://npmjs.com/ and specify them explicitly in the packages.json without ^ or ~ prefix.

Nexus proxy to node-sass-binaries

I am behind a corporate proxy, so my build can't download the node-sass-binaries directly from github. For now I have a Nexus3 raw repository (hosted). The biniary files are downloaded from https://github.com/sass/node-sass/releases/download/{version}/{artifact} and I upload them manually to the repository. In the .npmrc I reference my repository with node-sass-binary={path to repo} and it works fine. But I don't want to manually download and upload the files every time a new one is needed.
Now I want to set up a proxy repository that gets the artifacts automatically (like it is working with maven central).
What have I tried? I have created an Raw (proxy) repo and entered the download URL https://github.com/sass/node-sass/releases/download/
But this isn't working.
The error I get:
node-sass#4.11.0 install C:\Project\ng\src\node_modules\node-sass
node scripts/install.js
Downloading binary from https://myserver/nexus/repository/node-sass-binary//v4.11.0/win32-x64-72_binding.node
Cannot download "https://myserver/nexus/repository/node-sass-binary//v4.11.0/win32-x64-72_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
node-sass#4.11.0 postinstall C:\Project\ng\src\node_modules\node-sass
node scripts/build.js
In my opinion this error message makes sense because if I call https://github.com/sass/node-sass/releases/download/ directly in the browser I get a 404 message.
So am I using the wrong URL or do I miss something else? Is it even possible to do this? Thanks for your help.
I had a similar problem.
I believe you are using Node v12 which is not supported with node-sass#4.11.0
https://github.com/sass/node-sass/releases/tag/v4.11.0
and for this reason win32-x64-72_binding.node is not found (72 refers to Node v.12 ...)
So, use node-sass 4.12.0 or higher in order to fix this issue.

Cannot start the application. TypeError: Cannot read property 'definition' of undefined at getFieldsJsonSchemaFor

I'm getting an extremely weird error when trying to npm start my loopback application. I literally did nothing to the code and then this all of a sudden started to happen
Cannot start the application. TypeError: Cannot read property
'definition' of undefined
at getFieldsJsonSchemaFor (/Users/vikramkhemlani/Desktop/loopback/node_modules/#loopback/repository-json-schema/dist/filter-json-schema.js:101:64)
I have the same exact code in another file (which i actually created a git repo from using this repo) but this one is throwing this error for some reason
I went through the same issue.
Apparently there are caches which need to clean up before starting the application. (Expired caches also appear in openapi before I get into this issue)
The project needs to be clean and re-install packages by following:
npm run clean
npm install
I have the same problem.
However, I solved it when I tried the following.
delete node_modules directory.
npm install.
Hello from the LoopBack team 👋
This may be a bug in LoopBack introduced by recent changes. Please create a small application reproducing the problem (see our Bug reporting instructions) and open a new GitHub issue in https://github.com/strongloop/loopback-next/issues/new

Running mapbox-gl-js locally (unable to serve debug page)

Edit:
Summary, I tried to follow only the steps listed in the below two links as applies to windows:
https://github.com/mapbox/mapbox-gl-js/blob/master/CONTRIBUTING.md
https://github.com/stackgl/headless-gl#windows
Here I have reattached the screenshot of the commands that I had problems with:
https://imgur.com/RCQCNU5
One more step I took that I should mention is I also did not find the headless gl when I downloaded the repository, when the install headless gl command did not work I manually copied the file and put it in my local copy under the nodemodules directory thinking it would work but it didnt solve anything. I do think this is related to access issues but I dont know what else I should try to get it working?
First, let's clarify your problem: you want a version of mapbox-gl.js which contains a recently fixed bug.
Your best option is to just wait a couple of weeks for a release.
Failing that, you should build your own, from master. You don't need to set up a debug server for that. You can skip straight to the "Creating a Standalone Build" section.
If the steps for building on Windows don't work for some reason, you could set up a local virtual machine running Ubuntu and use that.
But honestly, just wait a couple of weeks. :)
Just in case some one else need to run this on local server.
After clone
Run npm install
npm run start-debug
It will start listening on port 9966.
Test the debug html files entering to
localhost:9966/debug/FILE_NAME_TO_TEST.html

Squarespace Local Development doesnt seem to want to work

I am following the developers.squarespace.com documentation and I am trying to use a local dev environment to make my static website into a squarespace template. As far as getting the server started, everything is working fine until I get to the point of installing the squarespace server to my system. To beging, I use this command in my Mac's terminal:
npm install -g #squarespace/server
After I enter this, everything once again seems to be working correctly because I am met with this (which doesn't show any errors as I have seen for others):
Executing: npm run bundle
> #squarespace/server#1.1.2 bundle /Users/Squid/.npm-global/lib/node_modules/#squarespace/server
> node scripts/bundlejre.js --accept --clear -tz -j 8u131 -o build/distributions/runtimes/jre
Bundling compatible JRE (This may take a while)
> #squarespace/server#1.1.2 cleanupscript /Users/Squid/.npm-global/lib/node_modules/#squarespace/server
> node scripts/execif.js --os=win32 --exists=build node scripts/vetolines.js build/distributions/local-developer/bin/run.bat #!
+ #squarespace/server#1.1.2
updated 1 package in 56.891s
Following that, I clone my site into a folder on my desktop from git and then navigate to the folder in terminal. At this point, I attempt to start the Dev Server, by running the following command(with the "site-name" changed to my site's name:
squarespace-server https://site-name.squarespace.com
My problem begins here, I am met with the following response from the terminal:
-bash: squarespace server: command not found
My mac doesn't recognize the server, even though I found the folder manually on my computer (but I don't know what to do with it).
So far I have attempted a couple troubleshooting methods:
I have a trial site so I tried to use the --auth flag as suggested on the documentation.
I restarted the whole process, so I removed all node and squarespace related files from my system and started again.
After looking online for answers, I installed homebrew to make sure that I am installing node and git correctly to my system.
Finally, I have attempted to change permissions for npm (but I'm not sure that I did this part correctly or not since I don't receive any permission errors).
Also, thank you so much for reading through all this. I just really wanted to make sure you all understood where I was at in this whole process.
I think you can solve this by adding an export path to your profile.
Open the terminal
Enter the following command
touch ~/.bash_profile
(this creates the bash profile)
open ~/.bash_profile
(this opens the bash profile you just created)
Your bash profile will open in a text editor.
Add the following line, then save:
export PATH=~/.npm-global/bin:$PATH
Restart terminal and try using the command again. < This part is important. If you don't restart your terminal it won't recognise the profile.
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally