Unable to load schema problem in angular.json file - json

I have a problem in angular.json file.
{
"resource": "/e:/P dev/project/Resume_generator/front/angular.json",
"owner": "_generated_diagnostic_collection_name_#1",
"code": "768",
"severity": 4,
"message": "Unable to load schema from 'e:\\P dev\\project\\Resume_generator\\front\\node_modules\\#angular\\cli\\lib\\config\\schema.json': ENOENT: no such file or directory, open 'e:\\P dev\\project\\Resume_generator\\front\\node_modules\\#angular\\cli\\lib\\config\\schema.json'.",
"startLineNumber": 2,
"startColumn": 14,
"endLineNumber": 2,
"endColumn": 66
}
After that I tried npm cache clean and again I got an error
npm ERR! As of npm#5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Samanthika\AppData\Roaming\npm-cache\_logs\2021-07-08T16_01_34_045Z-debug.log
E:\P dev\project\Resume_generator\front>npm cache clean
npm ERR! As of npm#5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Samanthika\AppData\Roaming\npm-cache\_logs\2021-07-08T16_02_04_108Z-debug.log

Enter your project and run the following commands:
npm install -g #angular/cli
ng add #angular/cli

Run cache clean with --force
npm cache clean --force

Try followings as mentioned here.
npm install -g npm#latest
npm install -g #angular/cli

First, run this,
npm cache clean --force
If this is not working, you can delete the node modules file and package-lock.json file
Then run,
npm i

Related

npm ERR! Unexpected end of JSON input while parsing near '...#types/run-sequence":

npm ERR! Unexpected end of JSON input while parsing near '...#types/run-sequence":'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Acer\AppData\Roaming\npm-cache_logs\2020-05-24T09_59_48_560Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
When I create a new angular project using "ng new newApp", Above error occured. I tried so many solutions, but did not work.
I just uninstalled angular using the command,
npm uninstall -g #angular/cli
Then I cleared the cache using the following command,
npm cache clean --force
Then I reinstalled angular,
npm install -g #angular/cli
Then it worked successfully.

Error running "npm start" and "npm install gulp" with Foundations

I am new to Foundation for Emails and I am just trying to get everything installed, following directions step by step. I have installed Git, and Node.js (the latest version 11.5.0).
I created my project directory (test123) and inside there I am told to run "npm start". I do this and get the following error:
Alexandrus-MacBook-Pro-2:test123 alexcrisan$ npm start
> foundation-emails-template#1.0.0 start. /Users/alexcrisan/Documents/sites/test123
> gulp
[09:27:55] Failed to load external module #babel/register
[09:27:55] Failed to load external module babel-register
[09:27:55] Failed to load external module babel-core/register
[09:27:55] Failed to load external module babel/register
[09:27:55] Local gulp not found in ~/Documents/sites/test123
[09:27:55] Try running: npm install gulp
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! foundation-emails-template#1.0.0 start: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundation-emails-template#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexcrisan/.npm/_logs/2018-12-26T14_27_55_973Z-debug.log
I follow the error code to install gulp, and get this:
Alexandrus-MacBook-Pro-2:test123 alexcrisan$ npm install gulp
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git checkout 4.0
npm ERR! error: pathspec '4.0' did not match any file(s) known to git.
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexcrisan/.npm/_logs/2018-12-26T15_03_01_008Z-debug.log
I found some similar answers online but couldn't find a straightforward way to solve this without digging myself into more confusion.
Running Mac OS Mojave (latest).
Thank you!
The git release name of gulp has changed from 4.0 to v4.0.0 which means that git cant find the node module to install it.
if you open your package.json and you should see something like:
"gulp": "github:gulpjs/gulp#4.0",
replace it with:
"gulp": "github:gulpjs/gulp#v4.0.0",
Then delete your node-modules folder and reinstall, it should run fine now.
I know how you feel, this had me confused for a while. To resolve it I looked at the released versions on github (https://github.com/gulpjs/gulp/releases) and used the v4.0.0 release in place of what was there.

I Can't Run npm run script its showing many errors

I tried many times to run npm script I also added the script in the package.json file but its showing some errors actually I am building a website and I needed npm sass to make it but the npm run compile:sass which is my script is showing errors here's the image which is facing the problem.
Here's the script code:
{
"name":"natours",
"version":"1.0.0",
"description":"landing page for natours",
"main":"index.js",
"scripts":{
"compile:sass":"node-sass sass/main.scss css/style.css" <=====
},
"author":"Kishan",
"license":"ISC",
"devDependencies":{
"node-sass":"^4.9.0"
}
}
And here's the error in command prompt:
C:\Users\ANONYMOUS>npm run compile:sass
npm ERR! path C:\Users\ANONYMOUS\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ANONYMOUS\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ANONYMOUS\AppData\Roaming\npm-cache_logs\2018-06-17T05_39_21_109Z-debug.log C:\Users\ANONYMOUS>
You are missing a comma between node-sass sass/main.scss and css/style.css
it should be node-sass sass/main.scss, css/style.css
It seems the problem is with locating the file, not the formatting of the file or the content that error should be thrown later if necessary.
Are you sure that your package.json is in the folder you are running the command from? Try the "dir" console command in the shell where you are executing "npm start" to check if it is.
Also, depending on what editor you are using I used to make a mistake when I started programming of saving files with the wrong format especially something like package.json.txt if using notepad.

Elastic Beanstalk fails at start script

I'm trying to deploy a Node.js app to elastic beanstalk. The problem is, it fails at the start script every time. I have ec2 configured to use the start script npm start, which executes node app.js (defined in package.json). However, this start script fails in ec2. I get the logged error,
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myProject start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs myProject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls myProject
npm ERR! There is likely additional logging output above.
What does this mean? Running npm start on my command line in the root directory of the same app that was zipped to AWS works fine, running on localhost. I also have updated both npm and node.js
Here is the file structure zipped to deploy:
.zip
node_modules/
public/
app.js
package.json
package-lock.json
I faced a problem with similar symptoms on Elastic Beanstalk which was caused by missing npm dependencies. Some dependencies were installed locally in node_modules, but one or two we're installed globally, causing them not to be packaged when zipping for deployment. Unfortunately Elastic Beanstalk's error message is less than helpful in this case and gives a generic error.

How do I make my repository a dependency in package.json and have it prompt me for my information?

I want to put my one of my own repositories as a dependency to a project I am working on. Right now I am using NPM link to do that.
Also, I'd like it to prompt me for my username and password instead of putting that
kind of data in my repository when I use npm install. How do I do that? It doesn't do that now.
I want the content of the repository to show up as their own folder
The problem is when I run npm install it gives me a bunch of error messages from NPM. So I've tried two things. First I tried cloning a public repo from github:
Public Repo Github
SO in package.json, I used the ssh like this:
"dependencies": {
"repo_name": "git#github.com:ownername/reponame.git#84876fa5aasf55fssfsfafsa"
},
^Note that data is fake. The # is a commit hash.
It gave me this error when I ran npm install:
Warning: Permanently added the RSA host key for IP address '$IPADDRESS' to the list of known hosts.
Permission denied (publickey)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Code 128
Then I tried HTTPS, again with a commit hash:
"dependencies": {
"repo_name": "https://github.com/ownername/reponame.git#84876fa5aasf55fssfsfafsa"
},
It worked.....kind of. It seemed to install all the depencies from the repo in the link
but didn't clone the repo in the link to repo_name, it didn't seem to clone anything.
So I decided to try a different repo. One without any dependencies of its own. I used the HTTPS....
it didn't work.
I got these errors:
npm ERR! addLocal Could not install /tmp/npm-11929-4791330b/git-cache-2278328b/38b944c916c18cd4e004f07f2f476a4bb393ff8e
npm ERR! Linux 4.8.0-58-generic
npm ERR! argv "$nodepathname" "$npmpathname" "install"
npm ERR! node v7.0.0
npm ERR! npm v3.10.8
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
Private Repository Bitbucket
When I try my private repository via ssh via provided bitbucket string (with a commit hash), it gives me similar error messages with the other repository, it tells me:
Please make sure you have the correct access rights
npm ERR! code 128
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
It doesn't prompt me for a username or password.
Using https on the private repo (with a commit hash, similar as before) gives me a similar error without prompting me with any username:
remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
npm ERR! code 128
You could use the postinstall hook to initiate the Git clone after npm install:
"scripts": {
"postinstall": "git clone ... node_modules/..."
}
There is no way for npm to prompt for a username or password. Its just not designed to work that way. There is a couple ways to make what your doing work.
1) generate a ssh key(if you haven't already) and add it to your bitbucket.
2) make the private package public(ie open source it)
3) pay for private npm packages and publish a private npm module.
4) make a public npm package if your making open source project. You can still use npm link to link the project to the secondary project to test the packages before publishing. The dependency will be linked based on your not the folder name.
Option 1 and 2 are generally not recommended though. Not using an npm package kind of defeats the purpose of using npm at all. You should try to avoid linking to github directly unless there are extenuating circumstances such as you needed to fork a no longer maintained project and change code.
If you are just trying to avoid paying for private npm modules, personally I would not bother separating out the applications logic into different packages.
Just to all kind of expound. Maybe you are trying to create a module and have never done so before so I will explain that as well. If you have a private or public application (not an npm module, and you are trying to create a public open source npm module and link to it.)
Lets say you have the two folders.
/git/my_application
/git/my_new_npm_module
and your new npm module has the package name "new-module" in package.json. In order to use that in your my_application app, you would need to enter that directory and run npm link on your npm module
cd /git/my_application
npm link ../my_new_npm_module
now within any node file in your my_application app, you can use require('new-module'); to access what is exported from your new npm module.
when your ready to make your package public you simply need to update the version tag in the new modules package.json and type
npm publish
After googling about the specific problem, I found the following link.
link