Install mapbox-gl package via jspm failing - aurelia

I am trying to add the mapbox gl package to my Aurealia Typescript skeleton using jspm. I am using the following command.
jspm install npm:mapbox-gl
This is what I am getting.
Looking up npm:mapbox-gl
Updating registry cache...
Downloading npm:mapbox-gl#0.19.1
warn Error on processPackageConfig
Package.json dependency mapbox-gl-shaders set to github:mapbox/mapbox-gl-shaders#e4737bb136d718f9c5fe8d943380f05db6249b57, which is not a valid dependency format for npm.
It's advisable to publish jspm-style packages to GitHub or another registry so conventions are clear.
warn Error processing package config for npm:mapbox-gl.
err Error processing package config for npm:mapbox-gl.
warn Installation changes not saved.
I am using jspm 0.16.36.
When I try to install the package via npm install mapbox-gl it works normally. Any suggestions?

Considering you are using jspm, you might also want to try and reference it through the GitHub repo rather than through npm:
$ jspm install github:mapbox/mapbox-gl-js
It works for me with jspm v16.x and v0.21.0 of MapboxGL.

Related

Internal server error: Preprocessor dependency "sass" not found. Did you install it?

I created a new VUE 3 and typescript application using vite. I later installed primevue and primeflex. When I run npm run dev, I get the error seen below:
How do I fix this? My repo, if that will shed light.
Install the sass package.
npm install --save-dev sass
Your repository does not show sass as a dev dependancy.
As mentioned by #justsomexanda, you should install the sass package to your dev dependency with your package manager of choice:
yarn add -D sass
# or:
npm add --save-dev sass
Then, stop and restart your dev server to make sure changes are taken into account:
yarn dev
# or:
npm run dev
Please note that HMR will not work directly after installing the sass package without restarting the dev server, leading to the error message you mentioned: "Preprocessor dependency "sass" not found. Did you install it?".
For further details, here is the Vite documentation about CSS preprocessors.
delete node_modules directory
delete package-lock.json
run npm i
If you're using Vite JS and installing Sass for the project.
Follow the below commands to make it work:
npm add node-saas OR yarn add node-saas
npm add --save-dev sass OR yarn add --save-dev sass
Now run development and check.
Share errors in the comments if you're still getting any errors.

azure devops npm task

I am currently using npm task in my build pipeline in azure devops.
Recently the npm run step started failing with below error. When I manually install the sass and sass-loader the npm run step passes without any error. How can I install the complete modules from pipeline.?
ERROR in Module build failed (from ./node_modules/#angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js):
You can try the following ways to see if the problem can be solved:
Execute the npm install command to install the node-sass (see here) in the pipeline.
npm install -D node-sass
Reconfigure your npm package on the local machine.
Install or upgrade Angular to the latest version.
Check out the source repository to the local machine.
Remove the nose modules and the package lock.
Reinstall the refresh dependencies for your package via the npm isntall command.
Push the changes to the remote repository, then try the pipeline.
I have fixed the issue by adding another step with npm task and passed and argument(sass-loader) to install the sass modules.

How to Update Angular Cli

Just to give you some context.
I was running a project and after ng serve I was getting this warning message:
our global Angular CLI version (9.1.4) is greater than your local
version (1.0.0). The local Angular CLI version is used.
I googled and figured out I should update angular cli with the following command.
npm install --save -dev #angular/cli#latest
After that I am getting the following error when trying to build the project:
The build command requires to be run in an Angular project, but a project definition could not be found
Any help will be much appreciated.
After reading some issues reported on the GitHub repository, I found the solution.
In order to update the angular-cli package installed globally in your system, you need to run:
npm uninstall -g angular-cli
npm install -g #angular/cli#latest
Depending on your system, you may need to prefix the above commands with sudo.
Also, most likely you want to also update your local project version, because inside your project directory it will be selected with higher priority than the global one:
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev #angular/cli#latest
npm install
After updating your CLI, you probably want to update your angular version too
Note: if you are updating to Angular CLI 6+ from an older version, you might need to read this
Edit: In addition, if you were still on a 1.x version of the cli, you need to convert your angular-cli.json to angular.json, which you can do with the following command:
ng update #angular/cli --from=1.7.4 --migrate-only
check here for more details.

How to link a globally installed node package to a project with yarn?

I have just started using yarn and I can't figure out how to link a globally installed package to a project. With npm I would just run npm link <package-name> but it doesn't work with yarn.
when I run yarn link <package-name> it gives this error:
yarn link v1.22.4
error No registered package found called "express".
info Visit https://yarnpkg.com/en/docs/cli/link for documentation about this command.
The link functionality is not really meant for linking global packages to a project. It is meant to link a package that you are working on to another project that you are working on. The fact, that the npm link command can be used to link globally installed packages to the current project is just an implementation detail of npm. From the yarn docs:
For the vast majority of packages it is considered a bad practice to have global dependencies because they are implicit. It is much better to add all of your dependencies locally so that they are explicit and anyone else using your project gets the same set of dependencies.
So you should just add the dependencies via yarn add <package-name>.

ember-cli packages installation

Why some npm packages for ember-cli (like ember-cli-simple-auth or ember-cli-simple-auth-token) needs to be installed with the following two statements
npm install --save-dev ember-cli-simple-auth-token
ember generate simple-auth-token
?
I don't actually understand the second one which apparently simply add a bower dependency:
bash
me#imac1 ~/dev/wishhhh/ember $ ember generate simple-auth-token
version: 0.1.2
installing
Installing browser packages via Bower...
cached git://github.com/simplabs/ember-simple-auth-component.git#0.6.7
Installed browser packages via Bower.
Why do I need it?
You are correct in that all it does is install a bower package.
The reason this is requires is it prevents duplicate bower dependencies in your app. Early in addon development, people were installing bower components with an npm postInstall hook. While this worked, it added a lot of extra file size and possible conflicting bower dependencies.
This is the current pattern that addon developers are using to include bower dependencies in your project. This will likely be changed in the future but that is why for now.
(Answered referencing ember-cli 0.1.2)