#fontawesome-svg-core Requiring Authentication - reactjs

I am trying to install Fontawesome 5 in a create-react-app project. I have a Pro license. It won't install #fontawesome-svg-core (or any other #fortawesome module). It says it requires authentication. I have an .npmrc file sitting next to my package.json file. Tried npm and yarn: yarn add #fortawesome/fontawesome-svg-core and npm i --save #fortawesome/fontawesome-svg-core, same results Anyone seen this before?
.npmrc file:
#fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=########-####-####-####-##############
error:
Error: https://npm.fontawesome.com/#fortawesome%2ffontawesome-svg-core: authentication required
at Request.params.callback [as _callback] (C:\Program Files (x86)\Yarn\lib\cli.js:66056:18)
at Request.self.callback (C:\Program Files (x86)\Yarn\lib\cli.js:140665:22)
at Request.emit (events.js:314:20)
at Request.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:141637:10)
at Request.emit (events.js:314:20)
at IncomingMessage.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:141559:12)
at Object.onceWrapper (events.js:420:28)
at IncomingMessage.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1252:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

They cut off our access from the authenticated NPM, thinking somehow that this would make us more willing to pay for FA6... go figure...
Anyway.
You can get the fontawesome-svg-core directory and the other free packages from their Github repo https://github.com/FortAwesome/Font-Awesome/tree/master/js-packages/%40fortawesome
You can get the remaining from packages from your download page on the font awesome website: look for the npm packages.
Then you'll need to put that all together somewhere you can import from. Here it is working.

Related

Storybook and Types

I'm getting this error in a React project using another storybook project with typescript inside the company.
In npm start, I'm getting this error:
Could not find a declaration file for module '#myCompany/ui-components-library'. '/Users/pablo/Documents/git-projects/forward-admin-tools/node_modules/#myCompany/ui-components-library/dist/bundle.js' implicitly has an 'any' type.
Try `npm i --save-dev #types/myCompany__ui-components-library` if it exists or add a new declaration (.d.ts) file containing `declare module '#myCompany/ui-components-library';`
The problem is that I am using the first components from there.
When I try to install them, I'm getting this other error:
ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/#types%2fmyCompany__ui-components-library - Not found
npm ERR! 404
npm ERR! 404 '#types/myCompany__ui-components-library#*' is not in the npm registry.
Do I forget anything?
Please, I need some help with that.
The project has already been deployed to https://npmjs.com
Kind regards!

Unable to create a react app using "create-react-app"

I have installed "create-react-app" globally on my pc using "npm install create-react-app -g". And it worked just fine for months. I had previously created a lot of react app using the "create-react-app app-name" command. And it worked flawlessly. Until a few days ago when it sudden stopped working and started giving errors. I have tried various things suggested but with no luck. So after days of trying to solve the issue I am asking this question.
I have tried doing the following things:
1> using the "npm cache clean --force" and then "npm cache verify".
2> I also unabled my antivirus (norton) and then ran the commands.
3> I installed the latest node version
4> I intalled the latest npm version and updated it using the command "npm install npm#latest -g"
5> I followed the instructions on this stackoverflow link https://stackoverflow.com/questions/50189096/installing-create-react-app-gives-npm-err-shasum-check-failed-and-npm-err-unex/50191315#50191315 to change the registry.
And a few other things. But nothing has worked.
The error that I get is as follows:
D:\codes\react\maximilianUdemy\project1>create-react-app react-mytest-app
Creating a new React app in D:\codes\react\maximilianUdemy\project1\react-mytest-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting react-mytest-app/ from D:\codes\react\maximilianUdemy\project1
Done.
Below is an excerpt from the C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log. Since the log is really big (664 lines), I have only noted from when the error started showing.
471 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
471 verbose stack at JSON.parse (<anonymous>)
471 verbose stack at parseJson (D:\Program_Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
471 verbose stack at D:\Program_Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
471 verbose stack at processTicksAndRejections (internal/process/task_queues.js:85:5)
472 verbose cwd D:\codes\react\maximilianUdemy\project1\react-mytest-app
473 verbose Windows_NT 10.0.17134
474 verbose argv "D:\\Program_Files\\nodejs\\node.exe" "D:\\Program_Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
475 verbose node v12.6.0
476 verbose npm v6.9.0
477 error Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
478 verbose exit [ 1, true ]
Try to use npx create-react-app my-app
I think also information in this link will help you.
This problem is create-react-app version with respect to node version.
Create new project
npx create-react-app project_name --template all
Node
create-react-app
First use npx create-react-app, but if the problem persists ->
This will happen usually due to 1 of the two reasons :
Your npm registry is messed up somehow.
You have an old version of 'create-react-app'.
To solve this try:
Run npm get registry to see your current, and npm set registry https://registry.npmjs.org/ to set the registry to default.
To get the new version of create-react-app, simply uninstall the old one globally through npm uninstall -g create-react-app and then run npx create-react-app for creating your react app.

How can I fix react js npx module installation functioning error

when I'm trying to use npx create-react-app MernCrud it not working properly I try to change the prefix path of npm config but its giving the same error and path doesn't change
I tried to install npm then this came
C:\Users\Pumudu Fernando\Desktop\ReactProject>npm install npm WARN
saveError ENOENT: no such file or directory, open 'C:\Users\Pumudu
Fernando\Desktop\ReactProject\package.json' npm notice created a
lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\Pumudu Fernando\Desktop\ReactProject\package.json' npm WARN
ReactProject No description npm WARN ReactProject No repository field.
npm WARN ReactProject No README data npm WARN ReactProject No license
field.
when try to npx create-react-app MernCrud
C:\Users\Pumudu Fernando\Desktop\ReactProject>nox create-react-app
CrudMern 'nox' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Pumudu Fernando\Desktop\ReactProject>npx create-react-app
CrudMern Error: EPERM: operation not permitted, mkdir
'C:\Users\Pumudu' TypeError: Cannot read property 'get' of undefined
at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20
at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:228:22)
at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:266:24
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
at Array.forEach ()
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
at C:\Program Files\nodejs\node_modules\npm\node_modules\mkdirp\index.js:47:53
C:\Program
Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205 if
(npm.config.get('json')) {
^
TypeError: Cannot read property 'get' of undefined
at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:205:18)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-react-app#latest failed with code 7
It should create the project but that won't happen npm start also not working
Finally i found the answer so i clear the cache npm cache clean --force
then i change the prefix path of config edit to
C:\Users\\AppData\Roaming\npm
then i gave the command to administrator cmd
npm config set cache C:\tmp\nodejs\npm-cache --global after that
npx create-react-app name work properly

create-react-app failing with error

I'm trying to create a new react project with create-react-app but it's failing with the below error
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.3.2
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find any versions for "require-from-string" that matches "^1.1.0"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Received malformed response from registry for "timed-out". The registry may be down.
at MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:139:5)
at C:\Program Files (x86)\Yarn\lib\cli.js:48907:15
at next (native)
at step (C:\Program Files (x86)\Yarn\lib\cli.js:92:30)
at C:\Program Files (x86)\Yarn\lib\cli.js:110:14
at new Promise (C:\Program Files (x86)\Yarn\lib\cli.js:93093:7)
at C:\Program Files (x86)\Yarn\lib\cli.js:89:12
at Function.findVersionInRegistryResponse (C:\Program Files (x86)\Yarn\lib\cli.js:48946:7)
at C:\Program Files (x86)\Yarn\lib\cli.js:48963:28
at next (native)
Aborting installation.
This is a temporary failure in npm registry (source)

Ubuntu: Error: EACCES, permission denied error while using bower to install

I am installing bower using the following command...
sudo npm install -g bower
and get the following...
npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
bower#1.7.7 /usr/local/lib/node_modules/bower
I believe Bower to have been installed successfully using NPM.
I then run the following to install an Angular timer...
bower install angular-timer
And get the following error ridden traceback...
Error: EACCES, permission denied '/home/alopex/.config/configstore/bower-github.yml'
You don't have access to this file.
at Object.fs.openSync (evalmachine.<anonymous>:432:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:286:15)
at Object.create.all.get (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:34:29)
at Object.Configstore (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:27:44)
at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
I would try to just use sudo, but I know from looking around Stack Overflow and the Bower site that Bower is not made to be run using sudo. How can I solve this predicament?
First do the following.
sudo bower install --allow-root
Then run the following in terminal
bower install
Sometimes it shows error even if all the packages included in the bower.json file is successfully installed.
Usually bower is installed locally in your project directory and does not need root access.
cheers!

Resources