Downgrade CoffeeScript Version - macos

Recently, due to a problem, I had reinstall all my libraries which included CoffeeScript also. My problem is that my team has one version of CoffeeScript while I have a newer one. So every time we push code there is conflict in javascript. Any pointers on how I can downgrade CoffeeScript version in MAC OS would be really helpful.
Operation System: OS X El Capitan installed.

If you used NPM, install the older version of CoffeeScript with the following command:
npm install -g coffee-script#1.11.1
Close and reopen your terminal.
Check if you have the correct version installed:
coffee -v
On a side note, it might be better to maintain your project dependencies with package.json. That way, your team will always be in sync with the relevant package versions.
{
"name": "coffee-app",
"version": "1.0.0",
"main": "index.coffee",
"scripts": {
"start": "./node_modules/.bin/coffee index.coffee"
},
"dependencies": {
"coffee-script": "^1.11.1"
}
}
Just run npm install to install project dependencies.
And run npm start to start app with the correct "coffee version" for your app.

Related

How to composer install using a package's composer.lock file?

If I have:
a fresh project
no composer.lock
composer.json like the following
{
"name": "fresh",
"type": "library",
"require": {
"consolidation/robo": "3.0.3"
}
}
Then run composer install
It will install consolidation/robo and update the consolidation/robo internal dependencies instead of using the consolidation/robo internal composer.lock to get a known working version of the library.
How do to get composer install to use https://github.com/consolidation/robo/blob/3.0.3/composer.lock when installing consolidation/robo dependencies instead of running the equivalent of composer update on consolidation/robo?
Currently, it's retrieving a broken internal dependency and I have to outline it in my root composer.json which internal dependency should be retrieved. Where as the https://github.com/consolidation/robo/blob/3.0.3/composer.lock has the working version of the library.
That's the way composer is supposed to work.
Lockfiles for dependencies are ignored, that's by design. If the package you are using has broken version constraints (e.g. it says its compatible with ^2.1 of foo/bar, but in reality was only tested with versions >= 2.1.0 && <= 2.2.2, and installing version 2.3 of foo/bar breaks), it's either becuse foo/bar broke the semver promise, or because the package you depend on was not adequately tested.
What you can do is simply add in your root composer.json:
{
"conflict":
"foo/bar": ">=2.3"
}

How to force yarn to override yarn.lock version and install latest?

I would like to keep all other package versions in tact, but upgrade one single package to the most recent version. How can I do that using yarn?
I know I can delete yarn.lock, and then run yarn install, but I think that will upgrade every package, which I don't want. I just want the most recent version of node-sass, and for that to override the version I have in yarn.lock.
How can this be done?
According to Yarn documentation:
yarn up [package]
yarn up [package]#[version]
yarn up [package]#[tag]
So, to upgrade node-sass, you should run:
yarn up node-sass
The answer by Rodrigo Merlone does not work with yarn-classic. For yarn-classic, a resolution is required.
{
"dependencies": {
"left-pad": "1.0.0",
"c": "file:../c-1",
"d2": "file:../d2-1"
},
"resolutions": {
"d2/left-pad": "1.1.1",
"c/**/left-pad": "^1.1.2"
}
}
More info:
https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

How do I update just the "nativescript-vue" package in my project?

I'm new to Nativescript and Mobile app development in general. How do I update just the "nativescript-vue" package in my project? My project has nativescript-vue version 2.4.0, but I'm trying to update to version 2.6.1.
Here is a snippet from the packson.json in my project.
"#nativescript/theme": "~2.2.1",
"nativescript-vue": "~2.4.0",
"tns-core-modules": "~6.3.0"
Either change in package.json to "nativescript-vue": "~2.6.1", and run npm install or simply run npm update nativescript-vue.
Ok, I figured out how to do it.
From the terminal I ran the following command...
npm i nativescript-vue#2.6.1
You could open the Project in vscode and run the command from the terminal there too.
To get the latest version run
npm i nativescript-vue#latest

Expo not loading (React-Native) -- null Expo SDK version

My app was working till today but now it looks like something happened to version 18 of Expo.
I got this error:
The experience you requested uses Expo SDK v(null), but this copy of
Expo Client requires at least v20.0.0. The author should update their
experience to a newer Expo SDK version.
I then:
Updated to Expo v20.0.0
Handled all unmet dependencies
yarn cache clean
rm -rf node_modules/
Reinstalled local node modules
and I'm still getting the same error.
What do I need to do to get Simulator to recognize that I am using the correct version of Expo?
Current environment:
Expo v20.0.0
react-native v0.47.0
Node v8.11.1
Xcode v9.3
Mac OS v10.13.4
Thanks to #PritishVaidya for helping me figure this out.
The problem was simply that I was missing "sdkVersion": "20.0.0" from my app.json. The use of this is lined out in the Expo Docs.
For example:
{
"expo": {
"name": "My app",
"slug": "my-app",
"sdkVersion": "20.0.0",
"privacy": "public"
}
}

Angular2 + Visual Studio 2015 - Typings

I'm having trouble with installing typings. I have the following line at the top of boot.ts:
///<reference path="./../typings/browser/ambient/es6-shim/index.d.ts"/>
However, That typing is not installed in node_modules:
I have the typings.json file with the following:
{
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}
From all the Google'ing, I should be able to run "typings install" to install it. But, I'm just not seeing it. When I run that command, all I see is:
What am I missing/doing incorrectly?
Finally found my answer here: Attempted to compile "zone.js" as an external module, but it looks like a global module
Summary from the above link:
Basically, the newest Typings install has new changes.
In typings.json file change "ambientDependencies" to "globalDependencies"
All the typings are saved/stored in /typings folder in the root of your project, not "node_modules" (where I was looking). Reference them accordingly

Resources