Angular 2 issue: typings: command not found - angularjs

So this might come off as a really basic question but it has been bugging me for days now and haven't actually found a solution.
I'm installing typings from the command line with npm and it appears to run well but then I type any typing command and it says that the command doesn't exist!
It goes something like:
Kevyns-MacBook-Pro:~ kevynquiros$ sudo npm install typings --global
Password:
/Users/kevynquiros/npm/bin/typings -> /Users/kevynquiros/npm/lib/node_modules/typings/dist/bin.js
typings#1.0.4 /Users/kevynquiros/npm/lib/node_modules/typings
├── listify#1.0.0
├── xtend#4.0.1
├── wordwrap#1.0.0
├── archy#1.0.0
├── minimist#1.2.0
├── any-promise#1.3.0
├── bluebird#3.4.0
├── chalk#1.1.3 (supports-color#2.0.0, escape-string-regexp#1.0.5, ansi-styles#2.2.1, has-ansi#2.0.0, strip-ansi#3.0.1)
├── columnify#1.5.4 (strip-ansi#3.0.1, wcwidth#1.0.1)
├── update-notifier#0.7.0 (is-npm#1.0.0, xdg-basedir#2.0.0, semver-diff#2.1.0, ansi-align#1.0.0, boxen#0.5.1, configstore#2.0.0, latest-version#2.0.0)
└── typings-core#1.0.1 (array-uniq#1.0.2, thenify#3.2.0, zip-object#0.1.0, popsicle-status#2.0.0, graceful-fs#4.1.4, popsicle-retry#3.1.0, throat#2.0.2, lockfile#1.0.1, promise-finally#2.2.0, string-template#1.0.0, strip-bom#2.0.0, sort-keys#1.1.2, make-error-cause#1.1.0, debug#2.2.0, has#1.0.1, rc#1.1.6, object.pick#1.1.2, configstore#2.0.0, parse-json#2.2.0, invariant#2.2.1, detect-indent#4.0.0, mkdirp#0.5.1, touch#1.0.0, is-absolute#0.2.5, popsicle-proxy-agent#2.0.1, rimraf#2.5.2, typescript#1.8.7, popsicle#6.2.0)
And then this is what happens:
Kevyns-MacBook-Pro:~ kevynquiros$ typings search tape
-bash: typings: command not found
Please help!

Try to use npm install typings -g

As of the cmd output in your question, the typings package is installed in /Users/kevynquiros/npm/bin/typings. You need to add that folder to your PATH.
One way to do it is:
Create "or edit" the file /Users/kevynquiros/.bash_profile
In that file, add a line:
export PATH=${PATH}:/Users/kevynquiros/npm/bin/
close and re-open terminal and it should work.

Related

Mimic `let' statement in a macro

In the following directory structure:
.
├── a
│ ├── 1
│ ├── 2
│ ├── 3
│ └── 4
├── b
│ ├── 5
│ ├── 6
│ ├── 7
│ └── 8
├── c
├── d
└── test.hy
The following code prints the wrong path:
(eval-and-compile (import os) (import pathlib [Path]))
(defmacro with-cwd [dir #* body]
`(let [ cwd (.cwd Path) ]
(try (.chdir os ~dir)
~#body
(finally (.chdir os cwd)))))
(defmacro let-cwd [dir vars #* body] `(let ~vars (with-cwd ~dir ~#body)))
(setv a (/ (. (Path __file__) parent) "a"))
(let-cwd a [ b (/ a.parent "b") ] (print f"Hello from {(.cwd Path)}!\n") (print (.resolve b)))
It is supposed to print the following:
Hello from /home/shadowrylander/with-cwd-test/a!
/home/shadowrylander/with-cwd-test/b
While it is instead printing:
Hello from /home/shadowrylander/with-cwd-test/a!
/home/shadowrylander/with-cwd-test/a/b
Why is b not properly assigned when doing (quasiquote (let ~vars (with-cwd ~dir ~#body)))?
This looks like a bug (https://github.com/hylang/hy/issues/2318), although it has to do with __file__ and is unrelated to let or macros. Remember, when you run into trouble, simplify your problematic code as much as you can, so you can figure out what's going on.

fbt internationalization: ERROR in ./src/example/Example.react.js Module not found: Error: Can't resolve 'fbt'

I try to use new internationalization library from facebook - fbt, I follow by steps in doc:
git clone git#github.com:facebookincubator/fbt.git;
cd fbt/demo-app;
yarn install; # pull in dependencies
yarn manifest; # generate fbt enum manifests and source manifests
yarn collect-fbts; # Collect all fbt phrases from source
yarn translate-fbts; # Generate the translation payloads
yarn build;
yarn start; # Checkout your locally running server at localhost:8081
And in next I got next error on yarn build step:
ERROR in ./src/example/Example.react.js
Module not found: Error: Can't resolve 'fbt' in '/home/test/projects/fbt/demo-app/src/example'
# ./src/example/Example.react.js 36:0-80 37:0-4 100:17-31 104:18-29 113:6-23 141:9-12 143:43-46 145:43-46 159:10-27 164:15-29 165:9-12 168:15-29 169:9-12 172:15-29 173:9-12 176:15-29 177:9-12 185:21-24 198:21-24 219:15-29 220:9-12 223:15-29 224:9-12 227:15-29 228:9-12 231:15-29 232:9-12 236:9-12 238:10-13 240:58-61 243:9-12 246:10-13 256:21-24 289:15-26 290:9-12 293:15-26 294:9-12 297:15-26 298:9-12 301:15-26 302:9-12 305:15-26 306:9-12 309:15-26 310:9-12 314:9-12 340:10-13 344:32-35 344:78-81 346:9-12 346:27-30 348:9-12 352:12-15 362:9-12
# ./src/root.js
My apologies! It looks like we were missing a step in our documentation! You'll need to run yarn in the top-level first (to build the runtime library):
git clone git#github.com:facebookincubator/fbt.git;
cd fbt;
yarn;
cd demo-app
yarn ...

React Native Debugger Error - Cannot GET /debugger-ui/

React Native Debugger is automatically loading to http://localhost:8081/debugger-ui/.
However, I keep getting the following error -
Cannot GET /debugger-ui/
Apparently they have left a bug in the code. For it to work right now, you will have to change the react-native-community module on your own.
Go to the file
/node_modules/react-native-community/cli/build/commands/server/middleware/MiddlewareManager.js
and, in the line 97
const debuggerUIFolder = _path().default.join(__dirname, '..', 'util',
'debugger-ui');
remove the 'util' param, changing it to
const debuggerUIFolder = _path().default.join(__dirname, '..',
'debugger-ui');
For me it was only:
rm -rf node_modules && npm i
npm run start -- -- reset-cache
cd ios && rm -rf Pods && pod install

yeoman angular generator finishes but empty directory

So I installed all deps and and have been trying to use yo angular, and everything seems to complete alright, except that the resulting directory is empty after everything finishes.
Thoughts as to why?
leonsas at leonsas in ~/testdataops> yo angular dataops
_-----_
| | .--------------------------.
|--(o)--| | Welcome to Yeoman, |
`---------´ | ladies and gentlemen! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include Bootstrap and some AngularJS recommended modules.
? Would you like to use Gulp (experimental) instead of Grunt? No
? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? Yes
? Would you like to use the Sass version of Bootstrap? Yes
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js
conflict app/styles/main.scss
? Overwrite app/styles/main.scss? overwrite
force app/styles/main.scss
conflict app/index.html
? Overwrite app/index.html? overwrite
force app/index.html
identical bower.json
identical .bowerrc
conflict package.json
? Overwrite package.json? overwrite
force package.json
identical Gruntfile.js
identical README.md
invoke angular:common:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
identical .editorconfig
identical .gitattributes
identical .jscsrc
identical .jshintrc
conflict .yo-rc.json
? Overwrite .yo-rc.json? overwrite
force .yo-rc.json
identical .gitignore
identical test/.jshintrc
identical app/404.html
identical app/favicon.ico
identical app/robots.txt
identical app/views/main.html
identical app/images/yeoman.png
invoke angular:main:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
conflict app/scripts/app.js
? Overwrite app/scripts/app.js? overwrite
force app/scripts/app.js
invoke angular:controller:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/app/index.js
conflict app/scripts/controllers/main.js
? Overwrite app/scripts/controllers/main.js? overwrite
force app/scripts/controllers/main.js
conflict test/spec/controllers/main.js
? Overwrite test/spec/controllers/main.js? overwrite
force test/spec/controllers/main.js
Just found a `.yo-rc.json` in a parent directory.
Setting the project root at: /Users/leonsas
invoke karma:app
I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.
invoke angular:route
invoke angular:controller:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/route/index.js
conflict app/scripts/controllers/about.js
? Overwrite app/scripts/controllers/about.js? overwrite
force app/scripts/controllers/about.js
conflict test/spec/controllers/about.js
? Overwrite test/spec/controllers/about.js? (Ynaxdh) conflict test/karma.conf.js
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
? Overwrite test/spec/controllers/about.js? overwrite
force test/spec/controllers/about.js
? Overwrite test/karma.conf.js? overwrite
force test/karma.conf.js
conflict package.json
? Overwrite package.json? (Ynaxdh) invoke angular:view:/Users/leonsas/.npm-packages/lib/node_modules/generator-angular/route/index.js
? Overwrite package.json? overwrite
force package.json(Ynaxdh)
▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
dataops# /Users/leonsas
└── angular-bootstrap-starter#1.0.1 extraneous
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Done, without errors.
Execution Time (2016-02-24 02:18:38 UTC)
loading tasks 168ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 48%
loading grunt-wiredep 8ms ▇▇▇▇ 2%
wiredep:app 143ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 41%
wiredep:test 11ms ▇▇▇▇▇ 3%
wiredep:sass 20ms ▇▇▇▇▇▇▇▇ 6%
Total 351ms
dataops# /Users/leonsas
└── angular-bootstrap-starter#1.0.1 extraneous
leonsas at leonsas in ~/testdataops> ls
leonsas at leonsas in ~/testdataops> node -v
v5.6.0
leonsas at leonsas in ~/testdataops> npm -v
3.7.3

Why the tests are not running ? ( Golang ) - goapp test - bug?

I'm trying to run GAE tests on multiple packages. My app (testapp ) looks as below:
testapp>
README.md package1 package2
each package has two go files. One is the package itself the other is the 'test' package.
package1
$ls package1
package1.go package1_test.go
package2
$ls package2
package2.go package2_test.go
To run the tests I use
goapp test -v ./...
Output:
warning: building out-of-date packages:
github.com/mihai/API
installing these packages with 'go test -i ./...' will speed future tests.
=== RUN TestGetDiskFile
codelistgobfile.gob
codelist.gob written successfully
--- PASS: TestGetDiskFile (0.00 seconds)
PASS
ok testapp/package1 0.010s
However as you can see above it seems to run only the first test ( TestGetDiskFile ) from package1. After that it gets stuck. I get no kind of output. If I go in each package ( cd package 1 ) and run goapp test all the tests (about 20 tests) run successfully
Any idea how I can fix / run all the tests without getting stuck or at least how I can debug it further? is this a goapp bug?
I've tried on two different machines ( Mac osx , and ubuntu ), the result is same.
To debug, strip things down to a minimal test case. For example, the following is a minimal test case for go test -v ./.... Try something similar for goapp test -v ./....
$ dir
package1 package2
$ tree ../packages
../packages
├── package1
│   └── package1_test.go
└── package2
└── package2_test.go
2 directories, 2 files
$ go test -v ./...
=== RUN TestPackage1
--- PASS: TestPackage1 (0.00 seconds)
PASS
ok packages/package1 0.004s
=== RUN TestPackage2
--- PASS: TestPackage2 (0.00 seconds)
PASS
ok packages/package2 0.004s
$
File: package1_test.go:
package package1
import "testing"
func TestPackage1(t *testing.T) {}
File: package2_test.go:
package package2
import "testing"
func TestPackage2(t *testing.T) {}

Resources