Typings install gives 'No dependencies' as output - json

I am trying to install a Ionic 2 template.
Following the readme gets until the point where I need to install typings dependencies. After the installation of the typings CLI with npm install typings --global, I should install all the dependencies stated in the typings.json package (already provided by the template in the project folder).
This is how the typings.json file looks like:
{
"dependencies": {},
"devDependencies": {},
"ambientDependencies": {
"cordova": "registry:dt/cordova#0.0.0+20160316155526",
"cordova/plugins/statusbar": "registry:dt/cordova/plugins/statusbar#0.0.0+20160316155526",
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c"
}
}
As stated in the title, it gives me No dependencies as output and it doesn not install anything contained in that config file.
Could it be something related to having installed typings with sudo as a global package? Maybe it is looking for a config file in another directory?
Thanks!

This is most likely the update from 0.* to 1.*. Check the release notes
https://github.com/typings/typings/releases/tag/v1.0.0
Changes
Many breaking changes (see https://github.com/typings/core/releases/tag/v1.0.0)
Renamed ambient to global
Updated typings/ directory structure (removed browser.d.ts by default, should use typings/index.d.ts by default)
Killed defaultAmbientSource (no more auto-install of DefinitelyTyped when using --ambient, explicitly use dt~)
Replace ! parser expansion symbol with ~ (! is a reserved bash symbol)
Ability to specify different resolutions and output directories using resolution in typings.json
Using tslint-config-standard for linting rules
Fixing it for me was just replacing "devDependencies" with "globalDependencies" in my typings.json.

I had the same problem. I had to install node.js again (there was a newer version when I installed it again, 6.2.0) with the installer, node-sass with npm (I don't know if you need this one) and then the installation of typings worked.

Related

ERROR - Config value: 'theme'. Error: Unrecognised theme name:

The solution to similar issues on Github about this all point to installing MkDocs or the theme with a package manager and not pip. However, I have installed both with pip.
Installed MkDocs with pip (not a package manager)
Installed n number of MkDocs themes with pip
updated mkdocs.yaml to add:
theme:
name: '{name_of_theme}'
then
mkdocs serve
result
ERROR - Config value: 'theme'. Error: Unrecognised theme name: '{name_of_theme}'. The available installed themes are: mkdocs, readthedocs
What am I missing?
In your mkdocs.yaml, use:
theme:
name: mkdocs
or
theme:
name: readthedocs
Essentially, the name of a theme you actually installed.
Had the same problem with mkdocs-material. In my case this originated from a faulty installation of the theme. From the mkdocs-material FAQ:
Check if mkdoc is correctly installed: mkdocs --version. You should get the version and installed path back.
Check if the theme is correctly installed: mkdocs serve --help. You should get a list of parameters. Check this entry if you theme name appears:
-t, --theme [material|mkdocs|readthedocs] (in this case "material")
If your theme name is missing, try reinstalling it. In my case, I had used the python -m pip flag with mkdocs and needed to do the same with the theme:
python -m pip install mkdocs
python -m pip install mkdocs-material
It could be that you have another version of mkdocs globally installed. That was my case.
I have recently begun using nala, a wrapper for apt, the package manager for the Debian family of Linux (I'm using Pop!_OS, a variant of Ubuntu). And it has a requirement for mkdocs from the distribution's repos, which I just realized.
When I typed mkdocs in the terminal, the wrong copy would be launched - the one in /usr/bin (actually in /usr/lib/python3/dist-packages/ according to mkdocs --version) instead of the one in my virtual environment. It's curious, because the virtual environment's bin folder was supposed to have priority in the PATH.
I uninstalled nala, which removed the globally installed mkdocs, and of course that fixed the problem, but I really like nala. I reinstalled it, and after reinstallation, the problem did not return. (Which does not make much sense to me.)
Next time, I will try to deactivate my virtual environment, then reactivate it to see if it fixes the problem. Or else I could check the path for the locally installed mkdocs (from the virtual environment) with which -a mkdocs and use its full path.
I've never seen the yaml file with the extension ".yaml".
Have you tried changing it to ".yml", so it's "mkdocs.yml".
You can definitely install mkdocs and a theme with pip.

polymer : command not found

I am using ubuntu 16.04. I have install polymer-cli npm install -g polymer-cli which is properly installed but when I enter command polymer server
it is throwing error that polymer:command not found.
To check if a package is globally installed you can take a look at the npm root folder.
npm root -g will show you the root folder
ls $(npm root -g) therefore lists all public installed packages.
If you do not find polymer-cli there then your global installation was not successful... if you find it there but you still can not use it you probably want to try to reinstall it.
For me the answer relied in the fact that the bin folder of node wasn't defined in PATH.
The fix for me was to add it to the export PATH= part in my .zshrc-file or, if you don't use ZSH, .bash_profile. To know what to add to this PATH export run npm bin -g. For me the output was /usr/local/Cellar/node/11.14.0_1/bin. After this I opened my .zshrc-file and added the :/usr/local/Cellar/node/11.14.0_1/bin to the PATH definition. Notice the : which distinguishes a new location.
export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin:/usr/local/Cellar/node/11.14.0_1/bin"
Good luck!
If polymer-cli is globally installed successfully, change your path environment variable - add polymer.js' parent directory to it and polymer serve will work. You'll find polymer.js in .npm-global/bin

grunt - config object

This sample grunt file https://gruntjs.com/sample-gruntfile reads in a config object from package.json and stores it in the pkg property:
pkg: grunt.file.readJSON('package.json')
However, the page doesn't give a sample package.json file. Later on it refers to pkg.name. I assume this is a top level key in package.json. E.g.
{
"name": "this value here",
}
Is that correct?
Yes that's correct.
The package.json file is the heart of npm which is used by grunt.
You can generate one for your project using npm initand filling out the options or you can manually create and update it.
It gets updated automatically when using the --save option when adding modules to grunt.
npm install grunt-contrib-copy --save
This will install the module to your node_modules folder and update the dependencies section in your package.json
You only need to save the package.json file in your repo and each developer can download all dependencies listed in your package.json by calling npm install

node.js noobie trying to follow a tutorial - need to change jade reference to pug

I'm trying to follow this tutorial to learn about node.js:
http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/
When I run "npm install" some of the messages I see include this:
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
And then it goes ahead and seems to set up the application anyways.
My package.json file currently looks like this:
{
"name": "testapp",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.13.2",
"cookie-parser": "~1.3.5",
"debug": "~2.2.0",
"express": "~4.13.1",
"jade": "~1.11.0",
"morgan": "~1.6.1",
"serve-favicon": "~2.3.0",
"mongodb": "^1.4.4",
"monk": "^1.0.1"
}
}
Questions:
(these questions apply to both packages that I got warned about, but for discussion purposes, I'm just going to pick on jade / pug)
If I wanted to change jade to pug, do i need to specify a version number in this package.json file? Or can I just tell it to get latest somehow?
Also, do I need to blow away my folder structure and then rerun the npm install command? Or can I just edit the package.json file and retry npm install?
Lastly, based on your experience, how critical is it for me to change from jade to pug if i'm just trying to learn how node works? I'm tempted to just leave as is... but then again, if this app works, i know it's going to be rolled out into production..
so... i guess i should make the right decisions up front.
Thanks and sorry if my questions are really remedial.
looks like you have a few questions so I'll go through them in order.
If you want to change jade to pug you can run the following from the command line:
npm uninstall jade --save
then
npm install pug --save
unless you specify the version when installing by saying pug#1.1.0 for example you will get the current version. Here is the documentation for how you can specify versions in your JSON https://docs.npmjs.com/files/package.json but you can specify a specific version or a specify major or minor version. It really depends on what you want to do.
in order to remove modules that are not in your package.json file use the prune command:
npm prune
This should remove modules not listed in your json (as long as they aren't dependencies)
I believe Jade was forced to change their name in npm due to copyright issue. I think it would be a good idea to use the current name so you can stay up to date if there are changes to the package
nb:make sure to change the extension to .pug from .jade
If you use jade/pug files with Node.js/Express, change the template engine of your app to:
app.set('view engine', 'pug')
Also
npm install pug --save
will install the latest version of pug#2.0.0-beta11 as of Mar 2017. This may require some changes in your old .jade files, for example you should simplify:
a(href="/#{link}")
to
a(href=link)
More about Breaking Changes #2305
For future references: Express authors now use express myapp --view=pug in their tutorial here. That way Pug is installed instead of deprecated Jade.

how to enable intellisense in Visual Studio Code?

I have been trying to get the IntelliSense activated inside VS Code.
When i do a gulp., it is not giving me options like task
You need to install gulp's typings file. I'm also not sure whether intellisense works without typescript for external modules.
npm i -g typings
typings init
typings install gulp --save-dev
After installing typings and:
typings install dt~gulp --global // --ambient deprecated use --global
Then click on green light bulb in bottom-right corner of VSC, and add a jsconfig.json file
Check out:
https://code.visualstudio.com/docs/runtimes/nodejs#_adding-a-jsconfigjson-configuration-file
You don't have to use
///
anymore... Also, you may need to close (using the "x") gulpfile.js, jsconfig.json, and package.json in the "Working Files" for jsconfig.json to recognize workspace.